Process all method like POST (with body).#165
Conversation
Originally this example: curl -v -XGET --data 'test' 'http://localhost:8080/service' does not finalize connection with client. With this change, connection closes and responds correctly.
|
Thanks for notifying about this bug. I still feel that GET (and GET-like) methods shouldn't support body provided in input. See: https://tools.ietf.org/html/rfc7231#section-4.3.1 "A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request." This commit ( b8f6578 ) going through travis right now should fix the bug you report but enforces the correct semantic of GET. It should be on head soon. Thanks again! |
I agree with reject as malformed method..., but, this is the answer of a stardards committe (I will omit which one) about their recommendation to 'post' body content using GET method:
So, I think the best solution is to support GETs with body AND have the functions to retrieve received data like in POST method: If I use POST I can request 'body' but I can't retreive that info if a GET is received. What do you think? Is there another function to retrieve body content when a GET is received? Best regards, |
|
I have to say that I disagree. Mostly on two points:
Even in this I understand how others have taken different approaches and consider my view - e.g. Elasticsearch allowing for body in GET because they felt that using POST might be inappropriate instead (mostly based on naming of the method).
For the above, I believe that syntactically the webserver should be immune from erroring when receiving a body (unless specified by the business logic above) but shouldn't support this use-case. As a general case though, I am quite fond to allow for ideas in disagreement with my recommended view of the world and of how this API should behave. In general, I like to segregate these behaviors using preprocessor directives so that "non-standard" behaviors can be supported to allow for specific needs. I am going to push the current change I have on the separate branch I linked (see: #166). I will be happy to receive a follow-up change from you to support the body-processing use-case if that is kept isolated within preprocessor option. Would that work? |

Description of the Change
Originally this example:
curl -v -XGET --data 'test' 'http://localhost:8080/service'
(GET metoth + data on body of request)
does not finalize connection with client.
Quantitative Performance Benefits
With this change, connection closes and responds correctly.
I am not completely sure that it is the best solution.
Verification Process
Using examples/service:
curl -v -XGET --data 'test' 'http://localhost:8080/service'
Applicable Issues
Release Notes