通用请求DEMO

public static void main(String[] args) throws IOException {
String encryptionKey="hklcrm140!!";
String JsnStr = "{\"appId\":\"XXX\"}";
YsPayDto dto = JSON.parseObject(JsnStr, YsPayDto.class);
String parmaStr = CryptoUtil.desEncode(encryptionKey, JSON.toJSONString(dto));
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost("XXXURL");
httpPost.addHeader("Content-type", "text/plain; charset=utf-8");
httpPost.setEntity(new StringEntity(parmaStr, "UTF-8"));
CloseableHttpResponse response = httpClient.execute(httpPost);
String bodyAsString = EntityUtils.toString(response.getEntity());
}