java HTTP 查询参数和 HTTP 表单参数之间的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10074359/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between an HTTP query parameter and HTTP form parameter?
提问by jiafu
What's the difference between an HTTP query parameter and an HTTP form parameter? I see the words in restful related documents. Can you give an example for the words in HTTP request.
HTTP 查询参数和 HTTP 表单参数有什么区别?我在restful相关文档中看到了这些词。你能举个例子,在HTTP请求中的单词。
采纳答案by Piotr Kochański
If you make request http://test.com?id=123, then id is a QueryParam (to be more precise this is GET request parameter), if you make POST request with a form inside body, then these form parameters (filled usually by user) are translated to FormParam-s.
如果您发出请求http://test.com?id=123,则 id 是一个 QueryParam(更准确地说,这是 GET 请求参数),如果您在正文中使用表单发出 POST 请求,则这些表单参数(填充通常由用户)被翻译成 FormParam-s。