4 ms·
> > Get messages can have a body, but not every server knows this. > I didnt know that. I would like to see more information about this too. I had an argument
by __david__ 13y ago
> > Get messages can have a body, but not every server knows this.
> I didnt know that. I would like to see more information about this too.
I had an argument with a co-worker about this. The spec is a bit ambiguous about GET requests with bodies.
Section 4.3 of RFC 2616 [1] says:
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.
Section 9.3 [2] is the section about GET requests and it never mentions request bodies (they call them entities in section 9) at all.
Section 9.8 [3], "TRACE" says:
A TRACE request MUST NOT include an entity.
So, 4.3 can be interpreted as: the spec does not disallow it, so it's allowed. But it can also be interpreted as: it isn't explicitly allowed in the GET section, so it isn't allowed. I think the wording is bad enough that it can be interpreted either way, especially because some methods explicitly allow request bodies (PUT, POST) and some explicitly disallow them (TRACE).
My personal opinion is that if they meant to disallow bodies in GETs then they would have said "...does not explicitly allow sending..." in section 4.3.
[1] https://tools.ietf.org/html/rfc2616#section-4.3 https://tools.ietf.org/html/rfc2616#section-4.3
[2] https://tools.ietf.org/html/rfc2616#section-9.3 https://tools.ietf.org/html/rfc2616#section-9.3
[3] https://tools.ietf.org/html/rfc2616#section-9.8 https://tools.ietf.org/html/rfc2616#section-9.8