我正在尝试执行post请求使用rest-assured with multipart/form-data,该请求包含一个带有参数的url和要附加的文件
下面是我正在尝试的代码,并得到握手错误,我如何使用url附加文件?
RequestSpecification httpRequest = RestAssured
.given()
.relaxedHTTPSValidation()
.cookie("SESSION", cookieVal)
.header("Content-Type", "multipart/form-data")
.header("accept","application/json")
.multiPart(new File("CorporateWallpaper.jpg")) ;
Response response = httpRequest.request().post(url);
System.out.print(response.getStatusCode());实际结果
javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1321)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1160)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)发布于 2019-01-15 22:06:25
对您的环境不是很确定。找到了这个link,你能检查一下协议版本吗?
https://stackoverflow.com/questions/54103121
复制相似问题