最近想用fidder模拟post请求,怎么都传值失败,发现写Composer => Request Body中写的内容,总是无法映射到mvc的action参数上。百度一番,发现如下解决方案:

Json格式数据传递

User-Agent: Fiddler  
Content-Type: application/json; charset=utf-8    

  这样在Requestbody里就可以编写json格式字符串了。

&拼接格式传递

User-Agent: Fiddler
Content-Type: application/x-www-form-urlencoded

  这样在Reuestbody里写 a=1&b=1

其实重点在于 设置合适的ContentType,另在Requestbody里填写的内容,后台也可以直接通过Request.InputStream获取。

相关文章:

  • 2021-05-15
  • 2022-02-07
  • 2021-08-31
  • 2022-01-21
  • 2021-11-19
  • 2021-10-23
  • 2022-12-23
猜你喜欢
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-11-20
  • 2021-11-10
相关资源
相似解决方案