java.lang.Object
cn.herodotus.stirrup.web.core.definition.utils.HttpUtils
直接已知子类:
CookieUtils, CookieUtils

public class HttpUtils extends Object

Description: Http 通用工具类

作者:
: gengwei.zheng
Date:
: 2024/2/5 21:50
  • 构造器详细资料

    • HttpUtils

      public HttpUtils()
  • 方法详细资料

    • get

      public static List<String> get(String cookie, String... name)
      获取多个 Cookie 请求头中的属性值
      参数:
      cookie - Cookie 请求头值
      name - Cookie中的属性名
      返回:
      cookie 中属性值的集合
    • getAny

      public static String getAny(String cookie, String... name)
      从 Cookie 请求头中,找到给定任意给定属性的值
      参数:
      cookie - Cookie 请求头值
      name - Cookie中的属性名
      返回:
      cookie 中属性值的集合
    • get

      public static String get(String cookie, String name)
      获取 Cookie 请求头中的属性值
      参数:
      cookie - Cookie 请求头值
      name - Cookie中的属性名
      返回:
      cookie 中属性值
    • isGetRequest

      public static boolean isGetRequest(org.springframework.http.HttpMethod method)
      判断是否为 GET 请求
      参数:
      method - HttpMethod
      返回:
      true 是 GET 请求,false 不是 GET 请求
    • isPostRequest

      public static Boolean isPostRequest(org.springframework.http.HttpMethod method, String contentType)
      判断是否为 POST 类型 请求
      参数:
      method - HttpMethod
      contentType - 内容类型
      返回:
      true 是 POST 请求,false 不是 POST 请求