Class RestTemplateUtil

java.lang.Object
net.mingsoft.basic.util.RestTemplateUtil

public class RestTemplateUtil extends Object
basic模块,spring RestTemplate工具类
Version:
版本号:100-000-000
创建日期:2017年9月5日
历史修订:
Author:
铭飞开发团队
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Class<T> responseType, Object... uriVariables)
    DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Class<T> responseType, Map<String,?> uriVariables)
    DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Object requestBody, Class<T> responseType, Object... uriVariables)
    DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Map<String,String> headers, Class<T> responseType, Object... uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Map<String,String> headers, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Object... uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
    自定义请求头和请求体的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
    自定义请求头和请求体的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Object... uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    delete(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的DELETE请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    exchange(String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
    通用调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    exchange(String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
    通用调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, Class<T> responseType)
    GET请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, Class<T> responseType, Object... uriVariables)
    GET请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, Class<T> responseType, Map<String,?> uriVariables)
    GET请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, Map<String,String> headers, Class<T> responseType, Object... uriVariables)
    带请求头的GET请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, Map<String,String> headers, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的GET请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Object... uriVariables)
    带请求头的GET请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    get(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的GET请求调用方式
    static org.springframework.http.HttpHeaders
    getHeaders(jakarta.servlet.http.HttpServletRequest request)
     
    static org.springframework.web.client.RestTemplate
    获取RestTemplate实例对象,可自由调用其方法
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, Class<T> responseType)
    POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, Object requestBody, Class<T> responseType)
    POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, Object requestBody, Class<T> responseType, Object... uriVariables)
    POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Object... uriVariables)
    带请求头的POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
    自定义请求头和请求体的POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
    自定义请求头和请求体的POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables)
    带请求头的POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    post(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的POST请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, Class<T> responseType, Object... uriVariables)
    PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, Object requestBody, Class<T> responseType, Object... uriVariables)
    PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Object... uriVariables)
    带请求头的PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
    自定义请求头和请求体的PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
    自定义请求头和请求体的PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables)
    带请求头的PUT请求调用方式
    static <T> org.springframework.http.ResponseEntity<T>
    put(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
    带请求头的PUT请求调用方式

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RestTemplateUtil

      public RestTemplateUtil()
  • Method Details

    • getHeaders

      public static org.springframework.http.HttpHeaders getHeaders(jakarta.servlet.http.HttpServletRequest request)
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, Class<T> responseType)
      GET请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      Returns:
      ResponseEntity 响应对象封装类
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, Class<T> responseType, Object... uriVariables)
      GET请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, Class<T> responseType, Map<String,?> uriVariables)
      GET请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, Map<String,String> headers, Class<T> responseType, Object... uriVariables)
      带请求头的GET请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Object... uriVariables)
      带请求头的GET请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, Map<String,String> headers, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的GET请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • get

      public static <T> org.springframework.http.ResponseEntity<T> get(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的GET请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, Class<T> responseType)
      POST请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      Returns:
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType)
      POST请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType, Object... uriVariables)
      POST请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      POST请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Object... uriVariables)
      带请求头的POST请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables)
      带请求头的POST请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的POST请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的POST请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
      自定义请求头和请求体的POST请求调用方式
      Parameters:
      url - 请求URL
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • post

      public static <T> org.springframework.http.ResponseEntity<T> post(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
      自定义请求头和请求体的POST请求调用方式
      Parameters:
      url - 请求URL
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, Class<T> responseType, Object... uriVariables)
      PUT请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, Object requestBody, Class<T> responseType, Object... uriVariables)
      PUT请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      PUT请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Object... uriVariables)
      带请求头的PUT请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables)
      带请求头的PUT请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的PUT请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的PUT请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
      自定义请求头和请求体的PUT请求调用方式
      Parameters:
      url - 请求URL
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • put

      public static <T> org.springframework.http.ResponseEntity<T> put(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
      自定义请求头和请求体的PUT请求调用方式
      Parameters:
      url - 请求URL
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Class<T> responseType, Object... uriVariables)
      DELETE请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Class<T> responseType, Map<String,?> uriVariables)
      DELETE请求调用方式
      Parameters:
      url - 请求URL
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Object requestBody, Class<T> responseType, Object... uriVariables)
      DELETE请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      DELETE请求调用方式
      Parameters:
      url - 请求URL
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Map<String,String> headers, Class<T> responseType, Object... uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Object... uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Map<String,String> headers, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, org.springframework.http.HttpHeaders headers, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Object... uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Object... uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, Map<String,String> headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, org.springframework.http.HttpHeaders headers, Object requestBody, Class<T> responseType, Map<String,?> uriVariables)
      带请求头的DELETE请求调用方式
      Parameters:
      url - 请求URL
      headers - 请求头参数
      requestBody - 请求参数体
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
      自定义请求头和请求体的DELETE请求调用方式
      Parameters:
      url - 请求URL
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • delete

      public static <T> org.springframework.http.ResponseEntity<T> delete(String url, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
      自定义请求头和请求体的DELETE请求调用方式
      Parameters:
      url - 请求URL
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • exchange

      public static <T> org.springframework.http.ResponseEntity<T> exchange(String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables)
      通用调用方式
      Parameters:
      url - 请求URL
      method - 请求方法类型
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,按顺序依次对应
      Returns:
      ResponseEntity 响应对象封装类
    • exchange

      public static <T> org.springframework.http.ResponseEntity<T> exchange(String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType, Map<String,?> uriVariables)
      通用调用方式
      Parameters:
      url - 请求URL
      method - 请求方法类型
      requestEntity - 请求头和请求体封装对象
      responseType - 返回对象类型
      uriVariables - URL中的变量,与Map中的key对应
      Returns:
      ResponseEntity 响应对象封装类
    • getRestTemplate

      public static org.springframework.web.client.RestTemplate getRestTemplate()
      获取RestTemplate实例对象,可自由调用其方法
      Returns:
      RestTemplate实例对象