开发者

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

开发者 https://www.devze.com 2023-01-23 22:46 出处:网络
This question already has answers here: 开发者_C百科Closed 12 years ago. Possible Duplicate: When do you use POST and when do you use GET?
This question already has answers here: 开发者_C百科 Closed 12 years ago.

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 ?


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! :)


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
0

精彩评论

暂无评论...
验证码 换一张
取 消