GET请求的参数被放入URL的查询字符串中。在POST请求中,它们位于请求正文中,那么URL是什么样的?

时间:2022-08-24 12:51:06

For example I may have a HTML form that uses a get method and produces the URL:

例如,我可能有一个使用get方法的HTML表单并生成URL:

http://localhost:8080/HelloForm?Name=Gareth+Wylie&Age=24&Formula=a+%2B+b+%3D%3D+13%25%21

for the the key-value pairs:

对于键值对:

Name: Gareth Wylie 

Age: 24 

Formula: a + b == 13%!

and for HelloForm.java (e.g. using java servlets)

并为HelloForm.java(例如使用java servlet)

If I had the same HTML form, but used the POST request, what would the URL look like?

如果我有相同的HTML表单,但使用了POST请求,那么URL会是什么样子?

1 个解决方案

#1


1  

The URL will be same as GET with the query parameters omitted. That is:

URL将与GET相同,省略查询参数。那是:

http://localhost:8080/HelloForm

#1


1  

The URL will be same as GET with the query parameters omitted. That is:

URL将与GET相同,省略查询参数。那是:

http://localhost:8080/HelloForm