Package com.gitee.apanlh.web.http
Enum HttpMethod
- java.lang.Object
-
- java.lang.Enum<HttpMethod>
-
- com.gitee.apanlh.web.http.HttpMethod
-
- All Implemented Interfaces:
Serializable,Comparable<HttpMethod>
public enum HttpMethod extends Enum<HttpMethod>
HttpRequest方法- Author:
- Pan
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMethodName()获取Request方法名static StringgetMethodName(HttpMethod requestMethod)获取Request方法名booleanhasDelete()是否请求DELETEbooleanhasGet()是否请求GETbooleanhasHead()是否请求GETbooleanhasOptions()是否请求OPTIONSbooleanhasPatch()是否请求PATCHbooleanhasPost()是否请求GETbooleanhasPut()是否请求PUTbooleanhasTrace()是否请求TRACEstatic HttpMethodvalueOf(String name)Returns the enum constant of this type with the specified name.static HttpMethod[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GET
public static final HttpMethod GET
GET请求方法
-
HEAD
public static final HttpMethod HEAD
HEAD请求方法
-
POST
public static final HttpMethod POST
POST请求方法
-
PUT
public static final HttpMethod PUT
PUT请求方法
-
PATCH
public static final HttpMethod PATCH
PATCH请求方法
-
DELETE
public static final HttpMethod DELETE
DELETE请求方法
-
OPTIONS
public static final HttpMethod OPTIONS
OPTIONS请求方法
-
TRACE
public static final HttpMethod TRACE
TRACE请求方法
-
-
Method Detail
-
values
public static HttpMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpMethod c : HttpMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
hasGet
public boolean hasGet()
是否请求GET- Returns:
- boolean
-
hasHead
public boolean hasHead()
是否请求GET- Returns:
- boolean
-
hasPost
public boolean hasPost()
是否请求GET- Returns:
- boolean
-
hasPut
public boolean hasPut()
是否请求PUT- Returns:
- boolean
-
hasPatch
public boolean hasPatch()
是否请求PATCH- Returns:
- boolean
-
hasDelete
public boolean hasDelete()
是否请求DELETE- Returns:
- boolean
-
hasOptions
public boolean hasOptions()
是否请求OPTIONS- Returns:
- boolean
-
hasTrace
public boolean hasTrace()
是否请求TRACE- Returns:
- boolean
-
getMethodName
public String getMethodName()
获取Request方法名- Returns:
- String
-
getMethodName
public static String getMethodName(HttpMethod requestMethod)
获取Request方法名- Parameters:
requestMethod- HTTP枚举- Returns:
- String
-
-