[
https://issues.apache.org/jira/browse/HTTPCLIENT-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15055125#comment-15055125
]
Oleg Kalnichevski commented on HTTPCLIENT-1703:
-----------------------------------------------
What spec? RFC 2616 is absolutely and unambiguously clear about PUT and POST
being the only standard entity enclosing methods. There is no requirement or
recommendation in the spec stating that it is valid for GET requests to enclose
a request entity. RFC 7230 section 3.3 states that request message framing is
independent of method semantics thus making it valid for GET requests to
enclose an entity though RFC 7231 states that payload within a GET request
message has no defined semantics. This is a diplomatic way of saying that
enclosing a request entity in a GET request is silly. Given that HC 4.x is
supposed to be complaint with RFC 2616, GET requests with a request entity will
be supported as of HC 5.0 only.
Oleg
> GET request should support body
> -------------------------------
>
> Key: HTTPCLIENT-1703
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1703
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: Fluent HC
> Affects Versions: 4.5.1
> Reporter: Konstantin Ignatyev
>
> I have discovered that fluent client does not allow BODY for a get request
> java.lang.IllegalStateException: GET request cannot enclose an entity
> at org.apache.http.client.fluent.Request.body(Request.java:348)
> at org.apache.http.client.fluent.Request.bodyString(Request.java:375)
> at
> kgi.mcytravel.wsite.services.FullTextSearchService.fullTextSearch(FullTextSearchService.scala:72)
> Which is not correct, spec does not prohibit GET request from having a body.
> It seems a bit unconventional but makes perfect sense considering complex
> search requests use case. And it is utilized by ElasticSearch for example
> https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html
> curl -XGET 'http://localhost:9200/twitter/tweet/_search?routing=kimchy' -d '{
> "query": {
> "bool" : {
> "must" : {
> "query_string" : {
> "query" : "some query string here"
> }
> },
> "filter" : {
> "term" : { "user" : "kimchy" }
> }
> }
> }
> }
> '
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]