| | |
| | | package com.smartor.config; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpEntity; |
| | | import org.apache.commons.httpclient.methods.PostMethod; |
| | | import org.apache.commons.httpclient.params.HttpMethodParams; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import sun.net.www.http.HttpClient; |
| | | |
| | | import javax.mail.Multipart; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | phonePort = "8001"; |
| | | } |
| | | HttpEntity<String> stringHttpEntity = HttpUtil.postJsonRequestV2(phoneIP + ":" + phonePort + path, req, String.class); |
| | | String responseBody = null; |
| | | try { |
| | | responseBody = new String(stringHttpEntity.getBody().getBytes("ISO-8859-1"), "UTF-8"); |
| | | System.out.println(responseBody); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return new String(stringHttpEntity.getBody().getBytes(StandardCharsets.UTF_8)); |
| | | } |
| | | |