使用GET请求发送POST数据有效? [英] Sending POST data with GET request valid?

查看:131
本文介绍了使用GET请求发送POST数据有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以curl为例,我可以在GET请求中发布数据。这是一个有效的事情吗?我的意思是:

a>,4.3节消息体:


如果请求方法的规范不能包含在请求中(第5.1.1节)不允许在请求中发送实体主体。

在9.3节GET中包含一个实体 - 身体是不被禁止的。



所以,是的,你可以发送一个带有HTTP GET请求的实体。


Using Curl for example, I can "post" data in a GET request. Is this a valid thing to do? With that I mean:

  • Is it not forbidden by any RFC specification?
  • Does someone out there use it with good reason?

Thanks for any help.

解决方案

See RFC2616 - Hypertext Transfer Protocol -- HTTP/1.1, section 4.3 "Message Body":

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.

In section 9.3 "GET" including an entity-body is not forbidden.

So, yes, you are allowed to send an entity-body with a HTTP GET request.

这篇关于使用GET请求发送POST数据有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆