录制好脚本以后,使用 JMeter 打开,直接运行测试,发现有个 Ajax 提交表单的时候出错了。服务器返回信息如下:
HTTP Status 415 -
type Status report
message
description The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.
        监听器 "察看结果树" 里发现该次请求:
Request Headers:
Content-Length: 7207
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
        既然是 Json 请求,这个 Content-Type 肯定有问题。所以为该次请求修改请求头里的 Content-Type 修正为 application/json;charset=UTF-8 之后,问题解决。

[转载]一次 JMeter 脚本请求错误 HTTP Status 415 的解决笔记

[转载]一次 JMeter 脚本请求错误 HTTP Status 415 的解决笔记--------------------- 
作者:Defonds 
来源:CSDN 
原文:https://blog.csdn.net/defonds/article/details/38495915 
版权声明:本文为博主原创文章,转载请附上博文链接!

相关文章:

  • 2021-12-13
  • 2021-11-20
  • 2021-10-10
  • 2022-02-02
  • 2021-09-01
  • 2021-09-21
猜你喜欢
  • 2021-11-06
  • 2021-07-04
  • 2022-12-23
  • 2021-09-22
  • 2021-12-28
相关资源
相似解决方案