如何使用Rest Assured并使用requestSpecBuilder和Content-type = application / x-ndjson执行发布请求

时间:2019-05-03 04:20:11

标签: rest-assured ndjson

如何使用Rest Assured并使用requestSpecBuilder和Content-type ='application / x- ndjson '

来执行发布请求

1 个答案:

答案 0 :(得分:0)

像这样指定您的请求规范

RequestSpecBuilder builder = new RequestSpecBuilder();
builder.addHeader("Content-Type", "application/x-ndjson");
RequestSpecification reqspec = builder.build();

然后

  

given()。spec( reqspec )。when()。then()