jmeter中HTTP请求{"userName":"test","password"="123456"}
运行报错:
"error":"Unsupported Media Type","message":"Content type 'text/plain' not supported"
此例中message信息,表示该post请求不支持“text/plain”纯文本格式类型
Media Type是互联网媒体类型,在Http协议消息头中,使用Content-Type来表示具体请求中的媒体类型信息
解决方法:
这里请求的是JSON格式参数要告诉服务器你是JSON格式的数据:
(取样器)HTTP请求 右键添加 配置元件(HTTP信息头管理器),添加:
名称:Content-Type
值:application/json
启动