类 HttpUtils

java.lang.Object
net.jlxxw.http.spider.util.HttpUtils

@Component public class HttpUtils extends Object
  • 构造器详细资料

    • HttpUtils

      public HttpUtils(@Autowired(required=false) AbstractRateLimiter abstractRateLimiter)
  • 方法详细资料

    • exchange

      public static <T> org.springframework.http.ResponseEntity<T> exchange(ProxyRestTemplateObject object, String url, org.springframework.http.HttpMethod method, @Nullable org.springframework.http.HttpEntity<?> requestEntity, Class<T> responseType) throws org.apache.hc.client5.http.HttpHostConnectException
      http get 请求
      类型参数:
      T - 数据类型
      参数:
      object - 具有代理能力的 rest template 对象
      url - 请求的地址
      method - method
      responseType - 应答数据类型
      返回:
      请求结果
      抛出:
      org.apache.hc.client5.http.HttpHostConnectException
    • execute

      public static <T> T execute(ProxyRestTemplateObject object, String url, org.springframework.http.HttpMethod method, @Nullable org.springframework.web.client.RequestCallback requestCallback, @Nullable org.springframework.web.client.ResponseExtractor<T> responseExtractor) throws org.apache.hc.client5.http.HttpHostConnectException
      抛出:
      org.apache.hc.client5.http.HttpHostConnectException