hurl icon indicating copy to clipboard operation
hurl copied to clipboard

How to test a 400 bad request error with Get, geT, Post, ....

Open joanhey opened this issue 7 months ago • 3 comments

Problem to solve

We want to test that the server or application return a 400 error when send a bad method: Get, GeT, geT,... Curl don't have any limitation to the method send, but hurl have it.

Image

Proposal

My proposal:

[FixedMethod]
get http://example.org
HTTP 400

But any other proposal that fix the problem is welcome !!

Also it'll be good change the message:

^ the HTTP method <Get> is not valid. Did you mean GET?
If you want to use the <Get> method add [FixedMethod] before

Additional context and resources

Tasks to complete

  • [ ] ...

joanhey avatar May 20 '25 10:05 joanhey

Hi @joanhey

You're right the current Hurl syntax ofr methode is uppercase [A-Z]+ (see https://github.com/Orange-OpenSource/hurl/issues/967 for the rationale). If there is enough demand for it, we can work on a syntax that allow any method to be used.

jcamiel avatar May 20 '25 11:05 jcamiel

Sorry, We need it to test a good benchmark [Thenchempower benchmark] https://www.techempower.com/benchmarks/#section=data-r23 We don't want artificials benchs and we need a language neutral test, like this one.

Thank you !!

joanhey avatar Aug 18 '25 01:08 joanhey

We only want it to test without a contract, with the frameworks !!

Thank you again !!

joanhey avatar Aug 18 '25 01:08 joanhey