Jmeter 报错 Response code:400 的解决办法
Posted meet-you
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jmeter 报错 Response code:400 的解决办法相关的知识,希望对你有一定的参考价值。
最近使用jmeter时,有部分接口一直在报错,内容如下两种
-----------------
Response code:400
Response message:Bad Request
--------------------------
Response code:Non HTTP response code: java.lang.IllegalArgumentException
Response message:Non HTTP response message: MIME type may not be blank
解决办法:
将client implementation配置成java问题解决了。
在网上找了下原因:
内容来源:https://www.cnblogs.com/glumer/p/11363156.html
总结:有加解密的情况下,默认的HTTPClinet在POST时会自动将特殊字符转义,然而Java在发送过程中却未处理;
jmeter发送http请求时,implementation会有以下几种选项
JAVA:使用的是JAVA JVM提供的http方法,但有一定的限制,
1、当jmeter释放一个请求后,同样的进程中可能不会再使用了;
2、只使用于单进程模式;
3、不支持虚拟主机,不支持相关的方法,不支持存储证书的请求
HttpClient4.1:使用的是Apache HttpClient4.1部件
空白:使用Http默认请求中配置或jmeter.properties中jmeter.httpsample中的配置
!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6IjMwNDEtMTU5NDk1ODAyNjQ5MSIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiJSIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6InMifSx7ImNoYXIiOiJwIn0seyJjaGFyIjoibyJ9LHsiY2hhciI6Im4ifSx7ImNoYXIiOiJzIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6IiAifSx7ImNoYXIiOiJtIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6InMifSx7ImNoYXIiOiJzIn0seyJjaGFyIjoiYS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iZSJ9LHsiY2hhciI6IjoifSx7ImNoYXIiOiI0In0seyJjaGFyIjoiMCJ9LHsiY2hhciI6IjAifV0sImlzUmljaFRleHQiOnRydWUsImtlZXBMaW5lQnJlYWsiOnRydWV9fSx7ImJsb2NrSWQiOiIzMDQxLTE1OTQ5NTgwMjY0OTEiLCJibG9ja1R5cGUiOiJwYXJhZ3JhcGgiLCJzdHlsZXMiOnsiYWxpZ24iOiJsZWZ0IiwiaW5kZW50IjowLCJ0ZXh0LWluZGVudCI6MCwibGluZS1oZWlnaHQiOjEuNzUsImJhY2stY29sb3IiOiIiLCJwYWRkaW5nIjoiIn0sInR5cGUiOiJwYXJhZ3JhcGgiLCJyaWNoVGV4dCI6eyJkYXRhIjpbeyJjaGFyIjoiUiJ9LHsiY2hhciI6ImUifSx7ImNoYXIiOiJzIn0seyJjaGFyIjoicCJ9LHsiY2hhciI6Im8ifSx7ImNoYXIiOiJuIn0seyJjaGFyIjoicyJ9LHsiY2hhciI6ImUifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoibSJ9LHsiY2hhciI6ImUifSx7ImNoYXIiOiJzIn0seyJjaGFyIjoicyJ9LHsiY2hhciI6ImEifSx7ImNoYXIiOiJnIn0seyJjaGFyIjoiZSJ9LHsiY2hhciI6IjoifSx7ImNoYXIiOiJCIn0seyJjaGFyIjoiYSJ9LHsiY2hhciI6ImQifSx7ImNoYXIiOiIgIn0seyJjaGFyIjoiUiJ9LHsiY2hhciI6ImUifSx7ImNoYXIiOiJxIn0seyJjaGFyIjoidSJ9LHsiY2hhciI6ImUifSx7ImNoYXIiOiJzIn0seyJjaGFyIjoidCJ9XSwiaXNSaWNoVGV4dCI6dHJ1ZSwia2VlcExpbmVCcmVhayI6dHJ1ZX19XQ==-->以上是关于Jmeter 报错 Response code:400 的解决办法的主要内容,如果未能解决你的问题,请参考以下文章
Jmeter Web 性能测试入门 :Jmeter 解析 response 并传递 value
Jmeter--如何调用Response返回值
性能测试坑 ① 无法查看结果树的报错内容,分析报错内容
jmeter中response data出现乱码的解决方法
jmeter处理request和response
jmeter解析response里的json对象和数组