hurl icon indicating copy to clipboard operation
hurl copied to clipboard

improve error message the HTTP method <> is not valid. Valid values are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH

Open teto opened this issue 1 year ago • 1 comments

What is the current bug behavior?

It's not a bug per-se but an error message that I find not clear and wonder if it could be improved:

46 | [Captures]
   | ^ the HTTP method <> is not valid. Valid values are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH

happens when I do

POST {{URL}}/v2/model_manager/model
content-type: application/json
accept: application/json

file,payloads/v2/toto.json;

# HTTP 201 # uncommenting this line makes the error go away

[Captures]
model: jsonpath "$"

shouldn't the error message be like "please add HTTP statement" or "valid values are 404,422,201, or any http codes" ? I suppose this error because it expects a new request.

Feel free to close this issue if it's intractable

teto avatar Aug 24 '23 17:08 teto

Hi @teto, HTTP statement is mandatory when Response is present:

image

We'll try to improve logging and documentation to make it clearer.

lepapareil avatar Aug 26 '23 13:08 lepapareil