hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Moore (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1124) Can't send request body with HTTP methods other than POST and PUT
Date Thu, 08 Sep 2011 13:22:08 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100307#comment-13100307

Jon Moore commented on HTTPCLIENT-1124:

@Oleg: I think this is a case where the RFC2119 language matters. Sec 4.3 says a client MUST
NOT send a body if the definition of the method "does not allow it." There are two ways to
interpret "does not allow", which is either that the method definition says you "MUST NOT
send a body with this request" or that the method definition omits saying you "MAY send a
body with this request." The definition for GET in Section 9.3 does not contain either one
of these statements. I will note that the definitions of POST and PUT do not use the RFC2119
language to say the request MAY contain a body. This suggests the protocol authors may have
had the former interpretation in mind (and indeed, Roy's cited comment supports this interpretation).
Since a receiver can safely ignore bodies on GETs, there is no interoperability issue, and
in general, if you observe the working group mailing list, you can see that they shy away
from MUST/MUST NOT if it doesn't affect interoperability.

@Alexey: It sounds to me like you actually want to report a bug against the authors of Dispatch,
because they are not providing a fully general API; if you view Dispatch as a form of proxy,
then they are not following the advice of Section 4.3: "A server SHOULD read and forward a
message-body on any request". The HttpClient library provides a way to implement that currently--in
fact, I had to face the same issue when writing the httpclient-cache module. So I really think
this is not a *bug* in HttpClient, as there is a way to achieve what you want, which is issuing
a DELETE with a body. [As an editorial note, I find it interesting that you think insulting
the volunteer maintainers of an open source project will help your case].

That said, I would be supportive of an *improvement* aimed at simplifying the API (namely,
removing the distinction between entity-enclosing and non-entity-enclosing requests) going
forward. But, of course, only if we can get agreement that there's no interoperability problem
here. :)

> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message