How are PUT parameters passed to a page?

2019-02-11 16:53发布

I can't find a precise answer on that question :

Are parameters which are sent by PUT passed in the URL, or in the HTTP header ?

I think it's the HTTP header, but when I submit my form with the PUT method, it appends the parameters to the URL !

2条回答
我只想做你的唯一
2楼-- · 2019-02-11 17:32

Are parameters which are sent by PUT passed in the URL, or in the HTTP header ?

Not the headers. It's the same as POST - either the URL or the body of the request. The only difference is the HTTP verb being used and of course the semantics that come with it (UPDATE a resource on the server).

查看更多
虎瘦雄心在
3楼-- · 2019-02-11 17:37

Your question seems to be about HTML forms. In which case the answer is: they do not support PUT (the browser still sends a POST request instead).

If it's not about HTML forms: it's up to you. For instance, in XmlHttpRequest you can use both.

查看更多
登录 后发表回答