Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String sendResult(ResultSendRequest resultSendRequest) {
- try {
- HttpPost httpPost = new HttpPost("http://176.99.11.185:33036/ivtest/0d5260f47e283b30426945d80a4f20d3");
- httpPost.addHeader("Content-type", "application/json");
- httpPost.setHeader("http.protocol.content-charset", "UTF-8");
- StringEntity stringEntity = new StringEntity(new Gson().toJson(resultSendRequest), StandardCharsets.UTF_8);
- httpPost.setEntity(stringEntity);
- CloseableHttpResponse response = httpClient.execute(httpPost);
- return new BasicResponseHandler().handleResponse(response);
- } catch (IOException e) {
- e.printStackTrace();
- return "error";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement