Fidder响应post的请求 request body里面填写的东西

 fidder在web开放的时候,感觉帮助大大滴,特别是对提供给手机调用借口的方法滴测试方面。。。

记得比较久以前,在大神的指导下,开始接触fidder这个东东,突然感觉,在调试给前台写服务的代码滴时候感觉到了一些光明。但是隔了几周没有,又忘记了post请求时,request body里面写什么东东了。结果百度了几下,得到了解决方法,写在下面,以供自己日和查阅。

若是想传json格式的数据可以这样写:(应该先勾选 post,然后写上正确滴请求地址)

 

[html] view plain copy
 
  1. User-Agent: Fiddler  
  2. Host: localhost:1455 <span style="color:#ff6666;"> 当然这个地方应该是你本地滴服务</span>  
  3. Content-Type: application/json; charset=utf-8    
  4. Content-Length: 38  

 

request body这样写:

[html] view plain copy
 
  1. {"参数名":"参数值","参数名":"参数值",...}  
[html] view plain copy
 
  1. 采用json传输可以很好滴给后台所采用 model类型对象进行赋值  
[html] view plain copy
 
  1.   
[html] view plain copy
 
  1. 若是传的不是json数据:  
[html] view plain copy
 
  1. User-Agent: Fiddler  
  2. Host: localhost:1455   
  3. Content-Type: application/x-www-form-urlencoded;<span style="font-family: Arial, Helvetica, sans-serif;">charset=utf-8  </span>  
  4. Content-Length: 38  
[html] view plain copy
 
  1. request body这样写:  
[html] view plain copy
 
  1. name1=valule1&name2=value2...  
[html] view plain copy
 
  1.   
[html] view plain copy
 
  1. Content-Type设置的很重要,设置滴和request body里面的数据类型不对。就不能传滴....  
posted @ 2016-12-01 13:55  草曰大  阅读(662)  评论(0)    收藏  举报