GET request with body

Adam Fisk a at littleshoot.org
Sun Oct 4 00:47:55 EDT 2009


I agree the 2616 is surprisingly vague on this point. Then again, why
would you ever want to include a body in GET request? I can't think of
any scenario where that's a good idea. POST or PUT seems more
appropriate.

-Adam


On Wed, Sep 30, 2009 at 4:08 AM, Nicholas Hagen
<nicholas.hagen at znetdevelopment.com> wrote:
> Actually, from my interpretation of the HTTP 1.1 protocol, HTTP
> servers are expected to permit the body and just ignore it:
>
>  From section 4.3 of http://www.ietf.org/rfc/rfc2616.txt
>
> A message-body MUST NOT be included in
>    a request if the specification of the request method (section 5.1.1)
>    does not allow sending an entity-body in requests. A server SHOULD
>    read and forward a message-body on any request; if the request
> method
>    does not include defined semantics for an entity-body, then the
>    message-body SHOULD be ignored when handling the request.
> Also note that the spec does not allow message body in HEAD requests
> but says they are ignored for HTTP 1.1 but may be used in a future
> HTTP spec.  Being the GET request really does not specify either
> context (included or not included), I would say that the HTTP spec
> would follow in line with HEAD and say it is allowed and may be used
> in a future extension of the protocol.  That's my guess why section
> 4.3 says that servers should read it and just ignore it.
>
> =================================
> Nicholas Hagen
> www.znetdevelopment.com
> =================================
> Now Available:  Push RSS
> RSS Viewer for iPhone OS 3
> www.znetdevelopment.com/znet/iphone.html
> =================================
>
> On Sep 30, 2009, at 1:50 AM, Frederic Bregier wrote:
>
>>
>> Hi Shay,
>>
>> I'm not totally a specialist, but in this case I think there are two
>> answers:
>>
>> 1) the HTTP protocol supposes that no body is transfered when a GET
>> request
>> occurs. I talk of course about the request, not the answer which
>> always
>> could have a body...
>>
>> 2) the http codec in Netty seems to be permissive, that is to say
>> that if a
>> GET request occurs, it could have a body however. But it is not
>> correct from
>> the HTTP protocol.
>>
>> HTH,
>> Frederic
>>
>>
>> Shay Banon wrote:
>>>
>>> Hi,
>>>
>>>  I am using netty http support and wanted to ask if netty supports
>>> GET
>>> operation with body (the http spec seems to be vague about that).
>>>
>>> Cheers,
>>> Shay
>>>
>>
>>
>> -----
>> Hardware/Software Architect
>> --
>> View this message in context: http://n2.nabble.com/GET-request-with-body-tp3739290p3740881.html
>> Sent from the Netty User Group mailing list archive at Nabble.com.
>> _______________________________________________
>> netty-users mailing list
>> netty-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/netty-users
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



-- 
Adam Fisk
http://www.littleshoot.org | http://adamfisk.wordpress.com |
http://twitter.com/adamfisk



More information about the netty-users mailing list