大家好,
同事告诉我,HTTP 1.0 和 1.1 中的 GET
方法是不同的。
向我解释的方式是,在 HTTP 1.0 中 GET
没有正文,因此您无法在正文中添加其他信息。所有变量都必须在 URI 中指定为 CGI 类型变量。
然而,在 HTTP 1.0 中,GET
允许使用正文,因此可以在 GET
消息正文中使用 XML(或其他方式)指定变量。
这是真的吗?我已经在网上爬行寻找 HTTP 1.0/1.1 文档、比较和其他内容,但我从未找到上述陈述?如果是真的,您能给我提供参考资料,以便我学习吗?
其他方法怎么样:PUT
、POST
和 DELETE
? 1.0 和 1.1 相同还是不同?
Greetings all,
I've been told by co-workers that the GET
method is different in HTTP 1.0 and 1.1.
The way it was explained to me was that in HTTP 1.0 GET
does not have a body, ergo you cannot add additional information in the body. All of the variables have to be specified in the URI as CGI type variables.
However, in HTTP 1.0 GET
allows a body, so one could specify variables using XML (or whatever) in the body of the GET
message.
Is this true? I've crawled the web looking for HTTP 1.0/1.1 documents, comparisons and otherwise, but I've never found the above statements? If it is true, can you point me to a reference so I can study up on it?
What about the other methods: PUT
, POST
and DELETE
? Are the same or different between 1.0 and 1.1?
发布评论
评论(2)
我认为任何方法定义都没有改变。
从技术上讲,您可以有一个 GET 请求正文,但这并不意味着这是一个好主意,或者它可以与所有库/中介/服务器一起使用。
I don't think any method definitions changed.
Technically, you could have a request body for GET, but that doesn't mean it's a good idea, or that it'll work with all libraries/intermediaries/servers.
为什么不看看 HTTP RFC?它们并不难读,而且是权威。您甚至可以只查看 1.1 RFC,看看发生了什么变化。
http://www.ietf.org/rfc/rfc1945.txt
http://www.ietf.org/rfc/rfc2616.txt
Why not take a look at the HTTP RFCs? They're not all that hard to read, and they're the authority. You could even just look at the 1.1 RFC and see what changed.
http://www.ietf.org/rfc/rfc1945.txt
http://www.ietf.org/rfc/rfc2616.txt