unirest doc
//http://kong.github.io/unirest-java/#requests
SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy() {
public boolean isTrusted(X509Certificate[] chain, String authType) {
return true;
}
}).build();
HttpClient customHttpClient = HttpClients.custom().setSSLContext(sslContext).setSSLHostnameVerifier(new NoopHostnameVerifier()).build();
Unirest.setHttpClient(customHttpClient);
/*
HttpRequestWithBody req = (requestMethod == "POST" ? Unirest.post(urlStr) : Unirest.put(urlStr));
req.header("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundaryyEmKNDsBKjB7QEqu");
req.header("Authorization", authorization);
*/
/*
MultipartBody body = Unirest.post(urlStr)
.header("Authorization", authorization)
.header("Content-Type", "multipart/form-data; boundary=*******************************************************************************")
.field("properties", "1111")
.field("contents", "2222");
HttpResponse<String> hres = body.asString();
'Java' 카테고리의 다른 글
datamatrix 생성 시 정사각형이 아닌 다른모양으로 생성될경우 (0) | 2023.04.17 |
---|---|
자바 리스트 간단하게 재정렬 방법 (0) | 2022.11.24 |
mssql 컬럼추가 (0) | 2020.05.11 |
object to .class (0) | 2016.08.25 |
한글 인코딩 테스트 인코딩 변환 (0) | 2016.08.12 |