Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9320D11BA0 for ; Sun, 11 May 2014 14:36:56 +0000 (UTC) Received: (qmail 12853 invoked by uid 500); 11 May 2014 14:30:16 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 12821 invoked by uid 500); 11 May 2014 14:30:16 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 12778 invoked by uid 99); 11 May 2014 14:30:16 -0000 Received: from Unknown (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 May 2014 14:30:16 +0000 Date: Sun, 11 May 2014 14:30:16 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCORE-380) Support for HTTP Delete with entity body MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCORE-380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13994561#comment-13994561 ] Oleg Kalnichevski commented on HTTPCORE-380: -------------------------------------------- I wholeheartedly second this statement! I am also of opinion that DELETE methods with an enclosed entity violates RFC2616 section 9.1.2 where DELETE method is defined as idempotent. However, once HTTP/1.1 bis is approved we may need to allow request entity for all methods besides TRACE. Oleg > Support for HTTP Delete with entity body > ---------------------------------------- > > Key: HTTPCORE-380 > URL: https://issues.apache.org/jira/browse/HTTPCORE-380 > Project: HttpComponents HttpCore > Issue Type: New Feature > Components: HttpCore, HttpCore NIO > Affects Versions: 4.4-alpha1 > Reporter: Jeewantha Dharmaparakrama > Fix For: Future > > Attachments: httpcore-nio.diff, httpcore.diff > > > 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 -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org