【发布时间】:2016-09-22 20:16:10
【问题描述】:
我有一个 JSON 正文作为 Java String。我想将此String 转换为RestAssured Response。这可能吗?
或者
是否可以将 apache HttpResponse 转换为 RestAssured Response
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(url);
org.apache.http.entity.StringEntity entity = new org.apache.http.entity.StringEntity(body);
httpPost.setEntity(entity);
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-type", "application/json");
HttpResponse httpResponse = httpClient.execute(httpPost);
我想将httpResponse 转换为RestAssured Response
【问题讨论】:
标签: java json httpclient httpresponse rest-assured