HTTP POST和GET的区别
来源:互联网 发布:mac魔兽争霸3打开黑屏 编辑:程序博客网 时间:2024/06/06 10:42
1、HTTP 只有POST和GET 两种命令模式;
2、POST是被设计用来向上放东西的,而GET是被设计用来从服务器取东西的,GET也能够向服务器传送较少的数据,而Get之所以也能传送数据,只是用来设计告诉服务器,你到底需要什么样的数据.POST的信息作为HTTP 请求的内容,而GET是在HTTP 头部传输的;
3、POST与GET在HTTP 中传送的方式不同,GET的参数是在HTTP 的头部传送的,而Post的数据则是在HTTP 请求的内容里传送;
4、POST传输数据时,不需要在URL中显示出来,而GET方法要在URL中显示;
5、GET方法由于受到URL长度的限制,只能传递大约1024字节;POST传输的数据量大,可以达到2M,而根据微软方面的说法,微软对用 Request.Form() 可接收的最大数据有限制,IIS 4 中为 80 KB 字节,IIS 5 中为 100 KB 字节;
6、SOAP是依赖于HTTP POST模式实现的;
例子:
HTTP GET
发送
GET /DEMOWebServices2.8/Service.asmx/CancelOrder?UserID=string&PWD=string&OrderConfirmation=string HTTP/1.1
Host: api.efxnow.com
回复
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<objPlaceOrderResponse xmlns="https://api.efxnow.com/webservices2.3">
<Success>boolean</Success>
<ErrorDescription>string</ErrorDescription>
<ErrorNumber>int</ErrorNumber>
<CustomerOrderReference>long</CustomerOrderReference>
<OrderConfirmation>string</OrderConfirmation>
<CustomerDealRef>string</CustomerDealRef>
</objPlaceOrderResponse>
HTTP POST
发送
POST /DEMOWebServices2.8/Service.asmx/CancelOrder HTTP/1.1
Host: api.efxnow.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
UserID=string&PWD=string&OrderConfirmation=string
回复
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<objPlaceOrderResponse xmlns="https://api.efxnow.com/webservices2.3">
<Success>boolean</Success>
<ErrorDescription>string</ErrorDescription>
<ErrorNumber>int</ErrorNumber>
<CustomerOrderReference>long</CustomerOrderReference>
<OrderConfirmation>string</OrderConfirmation>
<CustomerDealRef>string</CustomerDealRef>
</objPlaceOrderResponse>
SOAP 1.2
发送
POST /DEMOWebServices2.8/Service.asmx HTTP/1.1
Host: api.efxnow.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<CancelOrder xmlns="https://api.efxnow.com/webservices2.3">
<UserID>string</UserID>
<PWD>string</PWD>
<OrderConfirmation>string</OrderConfirmation>
</CancelOrder>
</soap12:Body>
</soap12:Envelope>
回复
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<CancelOrderResponse xmlns="https://api.efxnow.com/webservices2.3">
<CancelOrderResult>
<Success>boolean</Success>
<ErrorDescription>string</ErrorDescription>
<ErrorNumber>int</ErrorNumber>
<CustomerOrderReference>long</CustomerOrderReference>
<OrderConfirmation>string</OrderConfirmation>
<CustomerDealRef>string</CustomerDealRef>
</CancelOrderResult>
</CancelOrderResponse>
</soap12:Body>
</soap12:Envelope>
- HTTP的GET和POST的区别
- HTTP的GET和POST的区别
- HTTP POST和GET的区别
- Http Post和Get的区别
- http中get和post的区别
- Http关于Get和Post的区别
- HTTP POST和GET的区别
- HTTP POST和GET的区别
- HTTP POST和GET的区别详解
- HTTP GET和POST的区别
- http get和post的区别
- HTTP POST和GET的区别
- Http 的get和post区别
- http中get和post的区别
- HTTP中POST和GET的区别
- Http关于Get和Post的区别 .
- HTTP POST和GET的区别
- HTTP中GET和POST的区别
- MySQL事务以及select...for update
- ios编程之Core Data(一)
- 在父页面调用子页面的JS方法
- android bionic (Android的C/C++调用库)目录结构
- 用一个神奇的公式来计算用户体验
- HTTP POST和GET的区别
- Android中Service(服务)详解,四大组件之一:Service
- Andorid序列化方式Serizlizable和Parcelable
- 无法打开物理文件 操作系统错误 5:拒绝访问 SQL Sever
- RecyclerView 下拉刷新上拉加载(类似PullToRfresh)
- android属性动画animator
- 杭电-5567-水题
- bundler_0.4在windows下的编译
- C++ 11 在 Qt 5 中的应用