我正在尝试使用具有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)