全球彩票平台_全球彩票注册平台|官网下载地址

热门关键词: 全球彩票平台,全球彩票注册平台,全球彩官网下载地址

运用Fiddler测量检验基于WCF的REST,2参数绑定方法

WebAPI 2参数绑定方法,webapi2参数绑定

归纳类型参数

差十分的少类型参数

      以后我们能够用 WCF 4 轻便营造叁个REST Service,怎样测验呢?
先是让大家来看类图:

HTTP诉求中,假诺是get央求,那么表单参数以name=value&name1=value1的款型附到url的末尾,如若是post央浼,那么表单参数是在须要体中,也是以name=value&name1=value1的情势在乞请体中。通过chrome的开拓者工具得以看来如下(这里是可读的款式,不是当真的HTTP央求合同的呼吁格式):

简轻松单类型参数

Example 1: Sending a simple parameter in the Url

[RoutePrefix("api/values")]
public class ValuesController : ApiController
{
  // http://localhost:49407/api/values/example1?id=2
  [Route("example1")]
  [HttpGet]
  public string Get(int id)
  {
     return "value";
  }
}

 

Example 1: Sending a simple parameter in the Url

[RoutePrefix("api/values")]
public class ValuesController : ApiController
{
  // http://localhost:49407/api/values/example1?id=2
  [Route("example1")]
  [HttpGet]
  public string Get(int id)
  {
     return "value";
  }
}

 

全球彩票注册平台 1

get请求:

Example 1: Sending a simple parameter in the Url

[RoutePrefix("api/values")]
public class ValuesController : ApiController
{
  // http://localhost:49407/api/values/example1?id=2
  [Route("example1")]
  [HttpGet]
  public string Get(int id)
  {
     return "value";
  }
}

 

Example 2: Sending simple parameters in the Url

// http://localhost:49407/api/values/example2?id1=1&id2=2&id3=3
[Route("example2")]
[HttpGet]
public string GetWith3Parameters(int id1, long id2, double id3)
{
    return "value";
}

 

Example 2: Sending simple parameters in the Url

// http://localhost:49407/api/values/example2?id1=1&id2=2&id3=3
[Route("example2")]
[HttpGet]
public string GetWith3Parameters(int id1, long id2, double id3)
{
    return "value";
}

 

代码是如此的:

[plain]view plaincopy

Example 2: Sending simple parameters in the Url

// http://localhost:49407/api/values/example2?id1=1&id2=2&id3=3
[Route("example2")]
[HttpGet]
public string GetWith3Parameters(int id1, long id2, double id3)
{
    return "value";
}

 

Example 3: Sending simple parameters using attribute routing

// http://localhost:49407/api/values/example3/2/3/4
[Route("example3/{id1}/{id2}/{id3}")]
[HttpGet]
public string GetWith3ParametersAttributeRouting(int id1, long id2, double id3)
{
   return "value";
}

 

Example 3: Sending simple parameters using attribute routing

// http://localhost:49407/api/values/example3/2/3/4
[Route("example3/{id1}/{id2}/{id3}")]
[HttpGet]
public string GetWith3ParametersAttributeRouting(int id1, long id2, double id3)
{
   return "value";
}

 

   1:      [ServiceContract]

   2:      public interface IDataService

   3:      {

   4:            [OperationContract]

   5:            [WebGet(UriTemplate = "/Get?id={id}")]

   6:            Employee Get(int id);

   7:   

   8:            [OperationContract]

   9:            [WebInvoke(UriTemplate = "/Update?id={id}", Method = "PUT")]

  10:            bool Update(int id);

  11:   

  12:            [OperationContract]

  13:            [WebInvoke(UriTemplate = "/Del?id={id}", Method = "DELETE")]

  14:            bool Delete(int id);

  15:   

  16:            [OperationContract]

  17:            [WebInvoke(UriTemplate = "Create", Method = "POST")]

  18:            bool Create(Employee employee);

  19:      }

Example 3: Sending simple parameters using attribute routing

// http://localhost:49407/api/values/example3/2/3/4
[Route("example3/{id1}/{id2}/{id3}")]
[HttpGet]
public string GetWith3ParametersAttributeRouting(int id1, long id2, double id3)
{
   return "value";
}

 

Example 4: Sending an object in the Url

// http://localhost:49407/api/values/example4?id1=1&id2=2&id3=3
[Route("example4")]
[HttpGet]
public string GetWithUri([FromUri] ParamsObject paramsObject)
{
  return "value:"   paramsObject.Id1;
}

 

Example 4: Sending an object in the Url

// http://localhost:49407/api/values/example4?id1=1&id2=2&id3=3
[Route("example4")]
[HttpGet]
public string GetWithUri([FromUri] ParamsObject paramsObject)
{
  return "value:"   paramsObject.Id1;
}

 

Entity class:

RequestURL:

Example 4: Sending an object in the Url

// http://localhost:49407/api/values/example4?id1=1&id2=2&id3=3
[Route("example4")]
[HttpGet]
public string GetWithUri([FromUri] ParamsObject paramsObject)
{
  return "value:"   paramsObject.Id1;
}

 

Example 5: Sending an object in the Request body

[Route("example5")]
[HttpPost]
public string GetWithBody([FromBody] ParamsObject paramsObject)
{
  return "value:"   paramsObject.Id1;
}

注意 [FromBody] 只可以用二回,多于三遍将不可能健康干活

Example 5: Sending an object in the Request body

[Route("example5")]
[HttpPost]
public string GetWithBody([FromBody] ParamsObject paramsObject)
{
  return "value:"   paramsObject.Id1;
}

注意 [FromBody] 只好用叁遍,多于三次将不能够健康专门的学业

   1:      [DataContract]

   2:      public partial class Employee 

   3:      {

   4:          public Employee()

   5:          {}

   6:   

   7:          [DataMember]

   8:          public int EmployeeID { get; set; }

   9:          [DataMember]

  10:          public string NationalIDNumber { get; set; }

  11:          [DataMember]

  12:          public int ContactID { get; set; }

  13:          [DataMember]

  14:          public string LoginID { get; set; }

  15:          [DataMember]

  16:          public Nullable<int> ManagerID { get; set; }

  17:          [DataMember]

  18:          public string Title { get; set; }

  19:          [DataMember]

  20:          public System.DateTime BirthDate { get; set; }

  21:          [DataMember]

  22:          public string MaritalStatus { get; set; }

  23:          [DataMember]

  24:          public string Gender { get; set; }

  25:          [DataMember]

  26:          public System.DateTime HireDate { get; set; }

  27:          [DataMember]

  28:          public bool SalariedFlag { get; set; }

  29:          [DataMember]

  30:          public short VacationHours { get; set; }

  31:          [DataMember]

  32:          public short SickLeaveHours { get; set; }

  33:          [DataMember]

  34:          public bool CurrentFlag { get; set; }

  35:          [DataMember]

  36:          public System.Guid rowguid { get; set; }

  37:          [DataMember]

  38:          public System.DateTime ModifiedDate { get; set; }

  39:      }

Request Method:GET

Example 5: Sending an object in the Request body

[Route("example5")]
[HttpPost]
public string GetWithBody([FromBody] ParamsObject paramsObject)
{
  return "value:"   paramsObject.Id1;
}

注意 [FromBody] 只可以用三回,多于一次将无法符合规律专门的学问

Calling the method using 全球彩票注册平台,Urlencoded in the body:

User-Agent: Fiddler
Host: localhost:49407
Content-Length: 32
Content-Type: application/x-www-form-urlencoded

id1=1&id2=2&id3=3

全球彩票注册平台 2

Calling the method using Urlencoded in the body:

User-Agent: Fiddler
Host: localhost:49407
Content-Length: 32
Content-Type: application/x-www-form-urlencoded

id1=1&id2=2&id3=3

全球彩票注册平台 3

实现的service,为了演示这里只是简短达成。

Status Code:200 OK

Calling the method using Urlencoded in the body:

User-Agent: Fiddler
Host: localhost:49407
Content-Length: 32
Content-Type: application/x-www-form-urlencoded

id1=1&id2=2&id3=3

User-Agent: Fiddler Host: localhost:49407 Content-Length: 32 Content-Type: application/json { "Id1" : 2, "Id2": 2, "Id3": 3} protected void Application_Start() { var xml = GlobalConfiguration.Configuration.Formatters.XmlFormatter; xml.UseXmlSerializer = true; The client request is as follows: User-Agent: Fiddler Content-Type: application/xml Host: localhost:49407 Content-Length: 65 <ParamsObject><Id1>7</Id1><Id2>8</Id2><Id3>9</Id3></ParamsObject>

 

// [Route("example6")] [HttpGet] public string GetListFromUri([FromUri] List<int> paramsObject) { if (paramsObject != null) { return "recieved a list with length:" paramsObject.Count; } return "NOTHING RECIEVED..."; }

Calling the method using Json in the body:

User-Agent: Fiddler
Host: localhost:49407
Content-Length: 32
Content-Type: application/json

{ "Id1" : 2, "Id2": 2, "Id3": 3}

全球彩票注册平台 4

 

Calling the method using XML in the body

This requires extra code in the Global.asax

protected void Application_Start()
{
   var xml = GlobalConfiguration.Configuration.Formatters.XmlFormatter;
   xml.UseXmlSerializer = true;
The client request is as follows:

User-Agent: Fiddler
Content-Type: application/xml
Host: localhost:49407
Content-Length: 65

<ParamsObject><Id1>7</Id1><Id2>8</Id2><Id3>9</Id3></ParamsObject>

 

全球彩票注册平台 5

 

 

Calling the method using Json in the body:

User-Agent: Fiddler
Host: localhost:49407
Content-Length: 32
Content-Type: application/json

{ "Id1" : 2, "Id2": 2, "Id3": 3}

全球彩票注册平台 6

 

Calling the method using XML in the body

This requires extra code in the Global.asax

protected void Application_Start()
{
   var xml = GlobalConfiguration.Configuration.Formatters.XmlFormatter;
   xml.UseXmlSerializer = true;
The client request is as follows:

User-Agent: Fiddler
Content-Type: application/xml
Host: localhost:49407
Content-Length: 65

<ParamsObject><Id1>7</Id1><Id2>8</Id2><Id3>9</Id3></ParamsObject>

 

全球彩票注册平台 7

 

 

   1:      /// <summary>

   2:      /// CRUD Service  http://www.cnblogs.com/wintersun

   3:      /// </summary>

   4:      public class CRUDService : IDataService

   5:      {

   6:          public Employee Get(int id)

   7:          {

   8:              return new Employee() { EmployeeID = 11, Title = "Engineer" };

   9:          }

  10:   

  11:          public bool Update(int id)

  12:          {

  13:              //TODO

  14:              return true;

  15:          }

  16:   

  17:          public bool Delete(int id)

  18:          {

  19:              //TODO

  20:              return true;

  21:          }

  22:   

  23:          public bool Create(Employee employee)

  24:          {

  25:              //TODO

  26:              return true;

  27:          }

  28:      }

Request Headers

Example 7: Sending an object list in the Body

// http://localhost:49407/api/values/example8
[Route("example8")]
[HttpPost]
public string GetListFromBody([FromBody] List<ParamsObject> paramsList)
{
  if (paramsList != null)
  {
     return "recieved a list with length:"   paramsList.Count;
  }

  return "NOTHING RECIEVED...";
}

 

数组和列表(Array,List)

数组和列表(Array,List)

Config文件是这么的:

Accept:text/html,application/xhtml xml,application/xml;q=0.9,image/webp,*/*;q=0.8

Calling with Json:

User-Agent: Fiddler
Content-Type: application/json
Host: localhost:49407
Content-Length: 91

[{"Id1":3,"Id2":76,"Id3":19},{"Id1":56,"Id2":87,"Id3":94},{"Id1":976,"Id2":345,"Id3":7554}]

User-Agent: Fiddler Content-Type: application/xml Host: localhost:49407 Content-Length: 258 <ArrayOfParamsObject> <ParamsObject><Id1>3</Id1><Id2>76</Id2><Id3>19</Id3></ParamsObject> <ParamsObject><Id1>56</Id1><Id2>87</Id2><Id3>94</Id3></ParamsObject> <ParamsObject><Id1>976</Id1><Id2>345</Id2><Id3>7554</Id3></ParamsObject> </ArrayOfParamsObject>

 

[Route("example8")] [HttpPost] public string GetListsFromBody([FromBody] List<List<ParamsObject>> paramsList) { if (paramsList != null) { return "recieved a list with length:" paramsList.Count; } return "NOTHING RECIEVED..."; }

  This is a little bit different to the previous examples. The body can only send one single object to Web API. Because of this, the lists of objects are wrapped in a list or a parent object.

POST http://localhost:49407/api/values/example8 HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: localhost:49407
Content-Length: 185

[
 [
  {"Id1":3,"Id2":76,"Id3":19},
  {"Id1":56,"Id2":87,"Id3":94},
  {"Id1":976,"Id2":345,"Id3":7554}
 ],
 [
  {"Id1":3,"Id2":76,"Id3":19},
  {"Id1":56,"Id2":87,"Id3":94},
  {"Id1":976,"Id2":345,"Id3":7554}
 ]
]

 

 

 

 

Example 6: Sending a simple list in the Url

// http://localhost:49407/api/values/example6?paramsObject=2,paramsObject=4,paramsObject=9
[Route("example6")]
[HttpGet]
public string GetListFromUri([FromUri] List<int> paramsObject)
{
  if (paramsObject != null)
  {
 return "recieved a list with length:"   paramsObject.Count;
  }

  return "NOTHING RECIEVED...";
}

Example 6: Sending a simple list in the Url

// http://localhost:49407/api/values/example6?paramsObject=2,paramsObject=4,paramsObject=9
[Route("example6")]
[HttpGet]
public string GetListFromUri([FromUri] List<int> paramsObject)
{
  if (paramsObject != null)
  {
    return "recieved a list with length:"   paramsObject.Count;
  }

  return "NOTHING RECIEVED...";
}
   1:    <system.serviceModel>

   2:      <services>

   3:        <service name="webdemo.CRUDService" behaviorConfiguration="ServiceBehaviour">

   4:          <endpoint address=""  binding="webHttpBinding" contract="webdemo.IDataService" behaviorConfiguration="web">

   5:          </endpoint>

   6:        </service>

   7:      </services>

   8:      <behaviors>

   9:        <endpointBehaviors>

  10:          <behavior name="web">

  11:            <webHttp />

  12:          </behavior>

  13:        </endpointBehaviors>

  14:        <serviceBehaviors>

  15:          <behavior name="ServiceBehaviour">

  16:            <serviceMetadata httpGetEnabled="true" />

  17:            <serviceDebug includeExceptionDetailInFaults="false" />

  18:          </behavior>

  19:          <behavior>

  20:            <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->

  21:            <serviceMetadata httpGetEnabled="true"/>

  22:            <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->

  23:            <serviceDebug includeExceptionDetailInFaults="false"/>

  24:          </behavior>

  25:        </serviceBehaviors>

  26:      </behaviors>

  27:      <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

  28:    </system.serviceModel>

Accept-Encoding:gzip,deflate,sdch

自定义参数

What if the default parameter binding is not enough? Then you can use the ModelBinder class to change your parameters and create your own parameter formats. You could also use ActionFilters for this. Many blogs exist which already explains how to use the ModelBinder class. See the links underneath.

 

Example 7: Sending an object list in the Body

// http://localhost:49407/api/values/example8
[Route("example8")]
[HttpPost]
public string GetListFromBody([FromBody] List<ParamsObject> paramsList)
{
  if (paramsList != null)
  {
     return "recieved a list with length:"   paramsList.Count;
  }

  return "NOTHING RECIEVED...";
}

 

Example 7: Sending an object list in the Body

// http://localhost:49407/api/values/example8
[Route("example8")]
[HttpPost]
public string GetListFromBody([FromBody] List<ParamsObject> paramsList)
{
  if (paramsList != null)
  {
     return "recieved a list with length:"   paramsList.Count;
  }

  return "NOTHING RECIEVED...";
}

 

留神,大家利用是webHttpBinding,在DEBUG时方可把includeExceptionDetailInFaults设置为true. 大家通用会动用Svcutil.exe变迁proxy类,但对webHttpBinding是不会生成Output.config的。

Accept-Language:zh-CN,zh;q=0.8,en;q=0.6

文本和二进制

Files or binaries can also be sent to Web API methods. The article demonstrates how to do this.

 

Calling with Json:

User-Agent: Fiddler
Content-Type: application/json
Host: localhost:49407
Content-Length: 91

[{"Id1":3,"Id2":76,"Id3":19},{"Id1":56,"Id2":87,"Id3":94},{"Id1":976,"Id2":345,"Id3":7554}]

全球彩票注册平台 8

Calling with Json:

User-Agent: Fiddler
Content-Type: application/json
Host: localhost:49407
Content-Length: 91

[{"Id1":3,"Id2":76,"Id3":19},{"Id1":56,"Id2":87,"Id3":94},{"Id1":976,"Id2":345,"Id3":7554}]

全球彩票注册平台 9

当大家编译,Host这些Service,你从浏览器中展开类似那样的ULacrosseL:

AlexaToolbar-ALX_NS_PH:AlexaToolbar/alxg-3.2

参考

2参数绑定方法,webapi2参数绑定 轻松类型参数 Example 1: Sending a simple parameter in the Url [RoutePrefix(api/values)]public class ValuesController : ApiCon...

Calling with XML:

User-Agent: Fiddler
Content-Type: application/xml
Host: localhost:49407
Content-Length: 258

<ArrayOfParamsObject>
<ParamsObject><Id1>3</Id1><Id2>76</Id2><Id3>19</Id3></ParamsObject>
<ParamsObject><Id1>56</Id1><Id2>87</Id2><Id3>94</Id3></ParamsObject>
<ParamsObject><Id1>976</Id1><Id2>345</Id2><Id3>7554</Id3></ParamsObject>
</ArrayOfParamsObject>

 

全球彩票注册平台 10

Calling with XML:

User-Agent: Fiddler
Content-Type: application/xml
Host: localhost:49407
Content-Length: 258

<ArrayOfParamsObject>
<ParamsObject><Id1>3</Id1><Id2>76</Id2><Id3>19</Id3></ParamsObject>
<ParamsObject><Id1>56</Id1><Id2>87</Id2><Id3>94</Id3></ParamsObject>
<ParamsObject><Id1>976</Id1><Id2>345</Id2><Id3>7554</Id3></ParamsObject>
</ArrayOfParamsObject>

 

全球彩票注册平台 11

Connection:keep-alive

Example 8: Sending object lists in the Body

[Route("example8")]
[HttpPost]
public string GetListsFromBody([FromBody] List<List<ParamsObject>> paramsList)
{
  if (paramsList != null)
  {
 return "recieved a list with length:"   paramsList.Count;
  }

  return "NOTHING RECIEVED...";
}

This is a little bit different to the previous examples. The body can only send one single object to Web API. Because of this, the lists of objects are wrapped in a list or a parent object.

POST http://localhost:49407/api/values/example8 HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: localhost:49407
Content-Length: 185

[
 [
  {"Id1":3,"Id2":76,"Id3":19},
  {"Id1":56,"Id2":87,"Id3":94},
  {"Id1":976,"Id2":345,"Id3":7554}
 ],
 [
  {"Id1":3,"Id2":76,"Id3":19},
  {"Id1":56,"Id2":87,"Id3":94},
  {"Id1":976,"Id2":345,"Id3":7554}
 ]
]

 

 

 

 

Example 8: Sending object lists in the Body

[Route("example8")]
[HttpPost]
public string GetListsFromBody([FromBody] List<List<ParamsObject>> paramsList)
{
  if (paramsList != null)
  {
    return "recieved a list with length:"   paramsList.Count;
  }

  return "NOTHING RECIEVED...";
}

This is a little bit different to the previous examples. The body can only send one single object to Web API. Because of this, the lists of objects are wrapped in a list or a parent object.

POST http://localhost:49407/api/values/example8 HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: localhost:49407
Content-Length: 185

[
 [
  {"Id1":3,"Id2":76,"Id3":19},
  {"Id1":56,"Id2":87,"Id3":94},
  {"Id1":976,"Id2":345,"Id3":7554}
 ],
 [
  {"Id1":3,"Id2":76,"Id3":19},
  {"Id1":56,"Id2":87,"Id3":94},
  {"Id1":976,"Id2":345,"Id3":7554}
 ]
]

 

 

 

 

调用Get的时序图,其余格局类似了。

Cookie:JSESSIONID=74AC93F9F572980B6FC10474CD8EDD8D

自定义参数

What if the default parameter binding is not enough? Then you can use the ModelBinder class to change your parameters and create your own parameter formats. You could also use ActionFilters for this. Many blogs exist which already explains how to use the ModelBinder class. See the links underneath.

 

自定义参数

What if the default parameter binding is not enough? Then you can use the ModelBinder class to change your parameters and create your own parameter formats. You could also use ActionFilters for this. Many blogs exist which already explains how to use the ModelBinder class. See the links underneath.

 

全球彩票注册平台 12

Host:127.0.0.1:8080

文件和二进制

Files or binaries can also be sent to Web API methods. The articledemonstrates how to do this.

 

文件和二进制

Files or binaries can also be sent to Web API methods. The articledemonstrates how to do this.

 

对于Http Get 操作大家能够一贯在浏览器测量检验,当大家拜望

Referer:

参考

参考

User-Agent:Mozilla/5.0 (Windows NT 6.1)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36

全球彩票注册平台 13

Query String Parameters

我们用Fiddler来测量试验,它有三个作用是Request Builder,上面来测验Get方法, Request RAW:

name:mikan

GET HTTP/1.1
User-Agent: Fiddler
Host: localhost:50422

address:street

下一场Response RAW是这么的:

Response Headers

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 28 Jun 2011 06:18:05 GMT
X-AspNet-Version: 4.0.30319
Content-Length: 651
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Connection: Close

<Employee xmlns=" xmlns:i="><BirthDate>0001-01-01T00:00:00</BirthDate><ContactID>0</ContactID><CurrentFlag>false</CurrentFlag><EmployeeID>11</EmployeeID><Gender i:nil="true"/><HireDate>0001-01-01T00:00:00</HireDate><LoginID i:nil="true"/><ManagerID i:nil="true"/><MaritalStatus i:nil="true"/><ModifiedDate>0001-01-01T00:00:00</ModifiedDate><NationalIDNumber i:nil="true"/><SalariedFlag>false</SalariedFlag><SickLeaveHours>0</SickLeaveHours><Title>Engineer</Title><VacationHours>0</VacationHours><rowguid>00000000-0000-0000-0000-000000000000</rowguid></Employee>

Content-Length:2

Request PUT :

Date:Sun, 11 May 2014 10:42:38 GMT

PUT HTTP/1.1
User-Agent: Fiddler
Host: localhost:50422

Server:Apache-Coyote/1.1

Response RAW:

Post请求:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 28 Jun 2011 06:20:15 GMT
X-AspNet-Version: 4.0.30319
Content-Length: 83
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Connection: Close

<boolean xmlns=">true</boolean>

[plain]view plaincopy

HTTP-PUT操作对大家的Update方法。接着是HTTP-DELETE, Request header RAW :

DELETE HTTP/1.1
User-Agent: Fiddler
Host: localhost:50422

RequestURL:

Response RAW:

Request Method:POST

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 28 Jun 2011 06:21:01 GMT
X-AspNet-Version: 4.0.30319
Content-Length: 83
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Connection: Close

<boolean xmlns=">true</boolean>

Status Code:200 OK

最后测量试验的是HTTP-POST方法,这些我们比较熟稔. Request RAW header:

Request Headers

POST HTTP/1.1
User-Agent: Fiddler
Content-Type: application/xml; charset=utf-8
Host: localhost:50422
Content-Length: 652

Accept:text/html,application/xhtml xml,application/xml;q=0.9,image/webp,*/*;q=0.8

与前方区别大家还索要POST叁个BODY,在Server端WCF会帮大家把XML反类别化成Object. 

Accept-Encoding:gzip,deflate,sdch

<Employee xmlns=" xmlns:i="><BirthDate>0001-01-01T00:00:00</BirthDate><ContactID>0</ContactID><CurrentFlag>false</CurrentFlag><EmployeeID>11</EmployeeID><Gender i:nil="true"/><HireDate>0001-01-01T00:00:00</HireDate><LoginID i:nil="true"/><ManagerID i:nil="true"/><MaritalStatus i:nil="true"/><ModifiedDate>0001-01-01T00:00:00</ModifiedDate><NationalIDNumber i:nil="true"/><SalariedFlag>false</SalariedFlag><SickLeaveHours>0</SickLeaveHours><Title>asdfasd</Title><VacationHours>0</VacationHours><rowguid>00000000-0000-0000-0000-000000000000</rowguid></Employee>

Accept-Language:zh-CN,zh;q=0.8,en;q=0.6

那边是依据XML的格式数据。看截图:

AlexaToolbar-ALX_NS_PH:AlexaToolbar/alxg-3.2

全球彩票注册平台 14

Cache-Control:max-age=0

本文由全球彩票平台发布于全球彩票注册平台编程,转载请注明出处:运用Fiddler测量检验基于WCF的REST,2参数绑定方法

TAG标签: 全球彩票平台
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。