1.引入依赖包
<!-- 远程调用 httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
2.编写工具类
#package com.nari.dms.cloud.pub;
import com.alibaba.fastjson.JSON;
import com.nari.dms.cloud.entity.po.affect.JsonResult;
import org.springframework.http.*;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
/**
* @author
* @create 2021-06-15 14:28
* @desc
**/
public class SendToSapTemple {
/**
* @param url 远程接口路径
* @param method 请求方式
* @param json 入参
* @return
* @throws IOException
*/
public static JsonResult HttpRestClient(String url, HttpM