What is the difference between GET and POST methods? [duplicate]

泄露秘密 提交于 2019-12-10 17:13:22

问题


Possible Duplicate:
When do you use POST and when do you use GET?

I know the basic difference between GET and POST methods. That is we can see the URL parameters in case of GET and can't see the URL parameters in case of POST. Of course we can pass huge amounts of data by POST which is not possible through GET.

Are there any other differences between these two methods ?


回答1:


GET is for data retrieval only. You can refine what you are getting but it is a read only setup and yes, as you mentioned anything used for refinement are part of the URL.

POST is meant for sending data, but is generally a way to 'break' the simple workings of HTML because you are neither guaranteed of anything that is happening, it can just fetch data, send data or delete data.

There are also PUT and DELETE in the HTML standards, but its all about finding web servers that support these actions as well. As the names imply PUT sends data for either the creation or updating while DELETE is for removal of data.

Enjoy! :)




回答2:


Other implementation differences in GET and POST:

  • they have different encoding schemes. multipart/form-data is for POST only
  • the result of POST may not result in an actual page.
  • url limit necessitates use of POST
  • If you are using HIDDEN inputs in form then submitting a GET request reveals those inputs


来源:https://stackoverflow.com/questions/4130646/what-is-the-difference-between-get-and-post-methods

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!