(急)请问如何取得web service响应中的Content-type属性值?
请问各位大侠,如何取得web service响应中的Content-type属性值以及如何设置Content-type属性的值?
希望各位能提供帮助,不胜感激!
HTTP GET
下面是一个 HTTP GET 请求和响应示例。所显示的占位符需要由实际值替换。
GET /TestWebService/test.asmx/HelloWorld? HTTP/1.1
Host: localhost
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">string</string>
HTTP POST
下面是一个 HTTP POST 请求和响应示例。所显示的占位符需要由实际值替换。
POST /TestWebService/test.asmx/HelloWorld HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: length
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">string</string>