public class HttpRequestImpl extends Object implements HttpRequest
Constructor and Description |
---|
HttpRequestImpl(HttpVersion version,
HttpMethod method,
String requestedPath,
String queryString,
Map<String,String> headers)
Creates a new HttpRequestImpl instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsHeader(String name)
Tells if the message contains some header
|
boolean |
containsParameter(String name)
Determines whether this request contains at least one parameter with the specified name
|
String |
getContentType()
Gets the
Content-Type header of the message. |
String |
getHeader(String name)
Returns the value of the HTTP header with the specified name.
|
Map<String,String> |
getHeaders() |
HttpMethod |
getMethod()
Return the HTTP method used for this message
HttpMethod |
String |
getParameter(String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist.
|
Map<String,List<String>> |
getParameters() |
HttpVersion |
getProtocolVersion()
The HTTP version of the message
|
String |
getQueryString() |
String |
getRequestPath()
Return the HTTP request path
|
boolean |
isKeepAlive() |
protected Matcher |
parameterPattern(String name) |
String |
toString() |
public HttpRequestImpl(HttpVersion version, HttpMethod method, String requestedPath, String queryString, Map<String,String> headers)
version
- The HTTP versionmethod
- The HTTP methodrequestedPath
- The request pathqueryString
- The query stringheaders
- The headerspublic HttpVersion getProtocolVersion()
getProtocolVersion
in interface HttpMessage
public String getContentType()
Content-Type
header of the message.getContentType
in interface HttpMessage
public boolean isKeepAlive()
isKeepAlive
in interface HttpMessage
true
if this message enables keep-alive connection.public String getHeader(String name)
getHeader
in interface HttpMessage
name
- The name of the desired headerpublic boolean containsHeader(String name)
containsHeader
in interface HttpMessage
name
- the Header's name we are looking fortrue
if the HTTP header with the specified name exists in this request.public Map<String,String> getHeaders()
getHeaders
in interface HttpMessage
Map
of HTTP headers whose key is a String
and whose value is a String
s.public boolean containsParameter(String name)
containsParameter
in interface HttpRequest
name
- The parameter nametrue
if this request contains at least one parameter with the specified namepublic String getParameter(String name)
getParameter
in interface HttpRequest
name
- The parameter namepublic Map<String,List<String>> getParameters()
getParameters
in interface HttpRequest
Map
of query parameters whose key is a String
and whose value is a
List
of String
s.public String getQueryString()
getQueryString
in interface HttpRequest
public HttpMethod getMethod()
HttpMethod
getMethod
in interface HttpRequest
public String getRequestPath()
getRequestPath
in interface HttpRequest
Copyright © 2004–2025 Apache MINA Project. All rights reserved.