public class HttpRequestImpl extends java.lang.Object implements HttpRequest
构造器和说明 |
---|
HttpRequestImpl(HttpVersion version,
HttpMethod method,
java.lang.String requestedPath,
java.lang.String queryString,
java.util.Map<java.lang.String,java.lang.String> headers) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
containsHeader(java.lang.String name) |
boolean |
containsParameter(java.lang.String name)
Determines whether this request contains at least one parameter with the specified name
|
java.lang.String |
getContentType()
Gets the Content-Type header of the message.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the HTTP header with the specified name.
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders() |
HttpMethod |
getMethod()
Return the HTTP method used for this message
HttpMethod |
java.lang.String |
getParameter(java.lang.String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getParameters() |
HttpVersion |
getProtocolVersion()
The HTTP version of the message
|
java.lang.String |
getQueryString() |
java.lang.String |
getRequestPath()
Retrurn the HTTP request path
|
boolean |
isKeepAlive() |
protected java.util.regex.Matcher |
parameterPattern(java.lang.String name) |
java.lang.String |
toString() |
public HttpRequestImpl(HttpVersion version, HttpMethod method, java.lang.String requestedPath, java.lang.String queryString, java.util.Map<java.lang.String,java.lang.String> headers)
public HttpVersion getProtocolVersion()
HttpMessage
getProtocolVersion
在接口中 HttpMessage
public java.lang.String getContentType()
HttpMessage
getContentType
在接口中 HttpMessage
public boolean isKeepAlive()
isKeepAlive
在接口中 HttpMessage
public java.lang.String getHeader(java.lang.String name)
HttpMessage
getHeader
在接口中 HttpMessage
name
- The name of the desired headerpublic boolean containsHeader(java.lang.String name)
containsHeader
在接口中 HttpMessage
name
- the Header's name we are looking forpublic java.util.Map<java.lang.String,java.lang.String> getHeaders()
getHeaders
在接口中 HttpMessage
Map
of HTTP headers whose key is a String
and whose value is a String
s.public boolean containsParameter(java.lang.String name)
HttpRequest
containsParameter
在接口中 HttpRequest
name
- The parameter namepublic java.lang.String getParameter(java.lang.String name)
HttpRequest
getParameter
在接口中 HttpRequest
name
- The parameter nameprotected java.util.regex.Matcher parameterPattern(java.lang.String name)
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameters()
getParameters
在接口中 HttpRequest
Map
of query parameters whose key is a String
and whose value is a
List
of String
s.public java.lang.String getQueryString()
getQueryString
在接口中 HttpRequest
public HttpMethod getMethod()
HttpRequest
HttpMethod
getMethod
在接口中 HttpRequest
public java.lang.String getRequestPath()
HttpRequest
getRequestPath
在接口中 HttpRequest
public java.lang.String toString()
toString
在类中 java.lang.Object