HTTP POST 请求的 POST 字符串是否始终为纯文本?
正如标题所说:
谈论 HTTP 请求:GET 始终是纯文本形式.. 即 GET www.myresource.com 但是 POST 请求?我知道你可以用 unicode 对其进行编码,但我的问题是: 是对字符串 POST 之后的文本部分进行编码还是同时对字符串 POST 进行编码?总是这样吗?
提前致谢!
as the title says:
speaking about HTTP requests: a GET is always in plain text.. i.e. GET www.myresource.com
but a POST request? I know that you can encode it with unicode but my question is this:
is encoded the part of the text after the string POST or also the string POST? is it always?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要澄清,但我会回答您所问的问题。
GET 和 POST 请求可以在语法上是等效的...考虑
与
脚本实际上是以完全相同的方式调用的。区别完全在于语义 -
POST
请求应该“做某事”,而GET
应该始终是安全的。但是,
POST
也可以包含正文。GET
不能 - 您只能传递 URL 中适合的内容。这允许文件上传,等等,而 GET 不可能做到。具体来说,使用multipart/form-data
编码,您可以发送未编码的二进制数据。这就是你问的吗?
You may need to clarify, but I'll answer what I think you're asking.
GET and POST requests can be syntactically equivalent... consider
versus
The script, in fact, is called in exactly the same way. The difference is entirely semantic -
POST
requests are expected to "do something", whileGET
s are supposed to be safe always.But,
POST
can also include a body.GET
cannot - you can only pass what you fit in the URL. This allows file uploads, and so on, that a GET couldn't possibly do. Specifically, using themultipart/form-data
encoding, you can send otherwise-unencoded binary data.Is that what you were asking?