0
我通过放心自动化其余api。UnsupportedOperationException:无效的内容类型应用程序/ json
当我通过REST客户端测试相同的API我没有得到任何问题,但是当我通过Rest Assured
自动化我得到无效的内容类型错误。
我的REST API是如下:
Response res = given()
.relaxedHTTPSValidation()
.body(model)
.with()
.contentType("application/json")
.then()
.post(ConfigReader.get("asset.temperature.push.url"));
return res.body().asString();
错误是:
{"message":"Execution exception[[UnsupportedOperationException: Invalid content type. Content-Type should be application/json or text/json, receivedapplication/json; charset=UTF-8]]"}
如何来解决这个问题