Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.59k stars 593 forks source link

trans body with get method #388

Closed dtdyq closed 3 years ago

dtdyq commented 3 years ago

Unirest.get() can not trans body.is it correct?

ryber commented 3 years ago

No,

Because the HTTP spec is very specific that servers should not honor any body on a GET

https://tools.ietf.org/html/rfc7231#page-24

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.

ryber commented 3 years ago

I'm going to go ahead and close this, feel free to follow up in the new github discussions if you want to chat more. https://github.com/Kong/unirest-java/discussions