hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Ignatyev (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1703) GET request should support body
Date Sun, 13 Dec 2015 19:55:46 GMT
Konstantin Ignatyev created HTTPCLIENT-1703:

             Summary: 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


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

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message