【发布时间】:2017-06-11 16:43:13
【问题描述】:
我正在尝试放心地传递 api 密钥。从邮递员那里,我使用具有价值的“X-Api-Key”获得了响应数据。但请放心,我看到的是空指针异常
Response res = given()
.header("key","55af7bc105c9c2ee98e2abb32979fee")
.when()
.get ("https://mbaseurl/api/v1/search-listings/").then().
// contentType(ContentType.JSON). // check that the content type return from the API is JSON
extract().response();
我尝试使用 .header("X-Api-Key", "value") 传递键值但没有成功
【问题讨论】:
-
你在哪里看到空指针?
-
我在打印响应时看到了它。谢谢,问题已经解决了。
标签: rest-assured