jira-importer opened a new issue, #884:
URL: https://github.com/apache/httpcomponents-core/issues/884

   **[Jeewantha 
Dharmaparakrama](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jeewamp)**
 opened 
**[HTTPCORE-380](https://issues.apache.org/jira/browse/HTTPCORE-380?redirect=false)**
 and commented
   
   Hi All,
   
   I have created a fix to support HTTP DELETEs with entity bodies. In HTTP 
Core, the HttpRequest object (BasicHttpRequest or 
BasicHttpEntityEnclosingRequest) is made by looking at the HTTP method. But 
sometimes an API could accept HTTP Deletes with payloads for example [1]. To 
support this I have introduced a new type of HTTP requests 
"HttpEntityPossibleEnclosingRequest". By calling the "getFinalHttpRequest" 
method in this class, the proper HTTP request object can be made, i.e. 
HttpRequest or HttpEntityEnclosingRequest. The logic is if the 
HttpEntityPossibleEnclosingRequest has the CONTENT_LENGTH header, an 
HttpEntityEnclosingRequest is made and an HttpRequest is made otherwise.
   
   Note. the spec does not prohibit an HTTP Delete having a payload [2] [3].
   
   [1] 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
   [2] http://stackoverflow.com/a/299696/1411653
   [3] http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7
   
   Thanks,
   Jeewantha
   
   
   ---
   
   **Affects:** 4.4-alpha1
   
   **Attachments:**
   - 
[httpcore.diff](https://issues.apache.org/jira/secure/attachment/12643707/httpcore.diff)
 (_7.04 kB_)
   - 
[httpcore-nio.diff](https://issues.apache.org/jira/secure/attachment/12643708/httpcore-nio.diff)
 (_1.28 kB_)
   
   0 votes, 6 watchers
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to