默认情况下将 accept 和 contentType 设置为 json 以放心
Set accept and contentType to json by default for restassured
如何在其余测试中将 accept 和 contentType 设置为 json 项目范围?
given()
.accept(ContentType.JSON)
.contentType(ContentType.JSON)
这将减少相当多的重复代码
RestAssured.requestSpecification = new RequestSpecBuilder()
.setContentType(ContentType.JSON)
.setAccept(ContentType.JSON)
.build();
如何在其余测试中将 accept 和 contentType 设置为 json 项目范围?
given()
.accept(ContentType.JSON)
.contentType(ContentType.JSON)
这将减少相当多的重复代码
RestAssured.requestSpecification = new RequestSpecBuilder()
.setContentType(ContentType.JSON)
.setAccept(ContentType.JSON)
.build();