[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Kalnichevski resolved HTTPCLIENT-1124.
-------------------------------------------

    Resolution: Invalid

The HTTP spec is absolutely clear and unambiguous about the semantics of the 
standard methods:  GET - get resource, PUT - create new resource, POST - modify 
resource, HEAD - resource metadata, DELETE - delete resource. Only PUT and POST 
are meant to enclose a request body and not any other.

If for _whatever_ crazy reason one absolutely needs to pervert the HTTP 
protocol one can always do
---
BasicHttpEntityEnclosingRequest request = new 
BasicHttpEntityEnclosingRequest("GET", "/crazy");
request.setEntity(new Stuff());
---  
or
---
class MyGet extends HttpEntityEnclosingRequestBase {

    @Override
    public String getMethod() {
        return "GET";
    }

};
---

Oleg

> Can't send request body with HTTP methods other than POST and PUT
> -----------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1124
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1124
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.1.2
>            Reporter: Alexey Levan
>            Priority: Minor
>
> I'd like to have a possibility to send an HttpEntity regardless of method of 
> request.  The HTTP spec doesn't prohibit that (AFAIK, even GET requests with 
> body are allowed), and any spec-compliant implementation shouldn't do it 
> either.  I suggest merging HttpEntityEnclosingRequestBase with 
> HttpRequestBase, since there's really no reason to make this artifical 
> restriction.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to