Get和Post方法之间的区别,尤其是在jquery中使用以调用Web服务或在MVC中 [英] Difference between Get and Post Method especially while using in jquery to call webservice OR in MVC

查看:102
本文介绍了Get和Post方法之间的区别,尤其是在jquery中使用以调用Web服务或在MVC中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请举例说明......



提前感谢...

Please give proper description with examples..

thanks in advance...

推荐答案

请点击此链接:点击此处



这是一个信息请求,可以通过简单的谷歌搜索找到答案。 :-)

或者您出于某种原因无法访问Google?
Follow this link: click right here.

This is a request for information, and the answer can be found with a simple google search. :-)
Or are you for some reason unable to access Google?


访问此处..



http://www.jquery4u.com/ajax/key-differences-post/ [ ^ ]
visit here..

http://www.jquery4u.com/ajax/key-differences-post/[^]

一些快速点可以是



GET方法优先用于只读操作,Post方法用于修改/操作数据的操作。但它只是一个最佳实践,甚至可以用来操纵数据。



Get创建一个名称和值配对的查询字符串,并将查询字符串附加到处理请求的服务器上的脚本的URL。帖子创建HTTP请求消息本身的名称和值对。



性能明智获取请求相对更快,因为创建GET请求相对简单并且不需要在HTTP主体中封装Post请求的开销。此外,最大长度限制使得Get得到更优化。缓存,书签也可以用于获取请求。



获取请求支持的数据类型仅限于文本数据基于URL和Post可以有文本甚至二进制类型。



一般来说,Ajax调用我们可以为Web服务提供GET或POST类型,但选择POST作为默认Web服务不适用于GET以防止跨站点请求。



希望这会给你一些想法。
Some of the quick points can be

GET method is preferred to be for Read-only actions and Post method for actions that modify/manipulate the data.But its just a best practice and even Get can be used to manipulate data.

The Get creates a name-and-value paired query string and appends the query string to the URL of the script on the server that handles the request.The Post creates the name-and-value pairs in the body of the HTTP request message itself.

performance wise Get request is comparatively faster as it’s relatively simpler as to create a GET request and overhead of encapsulation of the Post request in the HTTP body not needed . Also , maximum length restriction makes Get more optimized.Caching , Bookmarking also can be done for Get Request.

Type of Data supported for Get Request is restricted to text data since URL based and Post can have text or even binary type.

Generally Ajax calls we can have type of GET or POST for web service ,but POST chosen as default web service does not work with GET to prevent Cross site requests.

Hope this gives you a bit of idea .


这篇关于Get和Post方法之间的区别,尤其是在jquery中使用以调用Web服务或在MVC中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆