Package one.nio.http
Class Request
- java.lang.Object
-
- one.nio.http.Request
-
public class Request extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intMETHOD_CONNECTstatic intMETHOD_DELETEstatic intMETHOD_GETstatic intMETHOD_HEADstatic intMETHOD_OPTIONSstatic intMETHOD_PATCHstatic intMETHOD_POSTstatic intMETHOD_PUTstatic intMETHOD_TRACEstatic intNUMBER_OF_METHODS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String header)voidconsumeHeaders(String prefix, Consumer<String> suffixConsumer)byte[]getBody()StringgetHeader(String key)StringgetHeader(String key, String defaultValue)intgetHeaderCount()String[]getHeaders()StringgetHost()intgetMethod()StringgetMethodName()StringgetParameter(String key)StringgetParameter(String key, String defaultValue)Iterable<Map.Entry<String,String>>getParameters()Iterator<String>getParameters(String key)StringgetPath()Map<String,String>getPostParams()StringgetQueryString()StringgetRequiredHeader(String key)StringgetRequiredParameter(String key)StringgetURI()booleanisHttp11()voidsetBody(byte[] body)voidsetBodyUtf8(String body)byte[]toBytes()StringtoString()
-
-
-
Field Detail
-
METHOD_GET
public static final int METHOD_GET
- See Also:
- Constant Field Values
-
METHOD_POST
public static final int METHOD_POST
- See Also:
- Constant Field Values
-
METHOD_HEAD
public static final int METHOD_HEAD
- See Also:
- Constant Field Values
-
METHOD_OPTIONS
public static final int METHOD_OPTIONS
- See Also:
- Constant Field Values
-
METHOD_PUT
public static final int METHOD_PUT
- See Also:
- Constant Field Values
-
METHOD_DELETE
public static final int METHOD_DELETE
- See Also:
- Constant Field Values
-
METHOD_TRACE
public static final int METHOD_TRACE
- See Also:
- Constant Field Values
-
METHOD_CONNECT
public static final int METHOD_CONNECT
- See Also:
- Constant Field Values
-
METHOD_PATCH
public static final int METHOD_PATCH
- See Also:
- Constant Field Values
-
NUMBER_OF_METHODS
public static final int NUMBER_OF_METHODS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMethod
public int getMethod()
-
getMethodName
public String getMethodName()
-
getURI
public String getURI()
-
isHttp11
public boolean isHttp11()
-
getPath
public String getPath()
-
getQueryString
public String getQueryString()
-
getParameters
public Iterable<Map.Entry<String,String>> getParameters()
- Returns:
IterableoverStringkey[=[value]]parameters skipping empty parameters
-
getHeaderCount
public int getHeaderCount()
-
getHeaders
public String[] getHeaders()
-
addHeader
public void addHeader(String header)
-
getBody
public byte[] getBody()
-
setBody
public void setBody(byte[] body)
-
setBodyUtf8
public void setBodyUtf8(String body)
-
getHost
public String getHost()
-
toBytes
public byte[] toBytes()
-
-