0
我有一个JSON
正文作为Java String
。我想将此String
转换为RestAssured Response
。这可能吗?将字符串(Json)转换为其他确保响应
或者
是否有可能转换阿帕奇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
问题是我甚至升级到3.0.1我'RestAssured'版本,这是最新的,并声称有固定的问题后,让'handshake_failure'错误。我仍然看到它。这就是为什么我使用'HttpResponse' –
@ user1629109你能用这个错误的完整堆栈跟踪来更新你的问题吗?或者发布一个新的问题呢?听起来像是你真正想解决的问题。 – Adam
感谢您的回复。这正是我想要解决的问题https://github.com/rest-assured/rest-assured/issues/548。 RestAssured缺乏SNI支持。所以当我尝试连接一个实现了SNI的服务器时,我遇到了握手失败错误。但是Apache HttpClient就像一个魅力 –