类 HttpUtil

java.lang.Object
cn.warpin.core.util.HttpUtil

@Component public class HttpUtil extends Object
  • 字段详细资料

    • authorizationHeader

      private String authorizationHeader
  • 构造器详细资料

    • HttpUtil

      public HttpUtil()
  • 方法详细资料

    • postJson

      public String postJson(org.springframework.web.client.RestTemplate restTemplate, String url, Object content)
      json请求
      参数:
      restTemplate -
      content -
    • postJson

      public String postJson(org.springframework.web.client.RestTemplate restTemplate, String url, Object content, String username, String password)
      带鉴权头的postJson
      参数:
      restTemplate -
      url -
      content -
      username -
      password -
      返回:
    • postForm

      public String postForm(org.springframework.web.client.RestTemplate restTemplate, String url, Object content)
      post form请求
      参数:
      restTemplate -
      url -
      content -
      返回:
    • postForm

      public String postForm(org.springframework.web.client.RestTemplate restTemplate, String url, Object content, String username, String password)
      带鉴权头的postForm
      参数:
      restTemplate -
      url -
      content -
      username -
      password -
      返回:
    • get

      public String get(org.springframework.web.client.RestTemplate restTemplate, String url, Object content)
      get 请求
      参数:
      restTemplate -
      url -
      content -
      返回:
    • executeGet

      public static String executeGet(String url, String token)
      http5的Get请求
      参数:
      url -
      token -
      返回:
    • getClientIp

      public static String getClientIp(jakarta.servlet.http.HttpServletRequest request)
      获取客户端ip
      参数:
      request -
      返回: