[
https://issues.apache.org/jira/browse/HTTPCLIENT-1124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099570#comment-13099570
]
Alexey Levan commented on HTTPCLIENT-1124:
------------------------------------------
Well, ugh. Look, I don't even disagree with you. Your point about how the
request should be handled on the server is absolutely valid. But.
There's a difference between what things meant to be and how they are
specified. From the cited part of spec, yes, the server _should_ ignore the
body, but it's not _required_ to do so! And it's still compliant if it doesn't
work how it meant to work. And for client, it should be entirely possible to
construct a message that didn't mean to be constructed. And again, that
message will be a valid HTTP message. This may be perverted and crazy, but
that perversion and craziness is a part of the spec this library claims to
implement.
I completely understand why you don't like the idea of "wrong" methods; I don't
like it, too. But trying to solve this problem by putting additional
restrictions where there shoudn't be any is no less wrong. It's the user's
problem to make the requests the way they meant to be made. And there should
be way for a user to go crazy. Just because the spec allows for it.
There's no such thing as "Request with entity" in the spec. There're only
"Request"s, which may happen to have an entity within. Wherefrom is such
distinction in the library? _That_'s how things didn't mean to be.
Also, here's[1] what Roy Fielding says about the issue. Looks like he confirms
both our points of view.
[1] http://tech.groups.yahoo.com/group/rest-discuss/message/9962
> 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]