public class HttpMessage extends DefaultMessage
| Constructor and Description |
|---|
HttpMessage()
Empty constructor initializing with empty message payload.
|
HttpMessage(Message message)
Constructs copy of given message.
|
HttpMessage(Object payload)
Default message using message payload.
|
HttpMessage(Object payload,
Map<String,Object> headers)
Default message using message payload and headers.
|
| Modifier and Type | Method and Description |
|---|---|
HttpMessage |
accept(String accept)
Sets the Http accepted content type header for response.
|
HttpMessage |
addHeaderData(String headerData) |
HttpMessage |
contentType(String contentType)
Sets the Http request content type header.
|
HttpMessage |
contextPath(String contextPath)
Sets the Http request context path header.
|
HttpMessage |
cookie(javax.servlet.http.Cookie cookie)
Adds new cookie to this http message.
|
static HttpMessage |
fromRequestData(String requestData)
Reads request from complete request dump.
|
static HttpMessage |
fromResponseData(String responseData)
Reads response from complete response dump.
|
String |
getAccept()
Gets the accept header.
|
String |
getContentType()
Gets the Http content type header.
|
String |
getContextPath()
Gets the Http request context path.
|
List<javax.servlet.http.Cookie> |
getCookies()
Gets the cookies.
|
String |
getPath()
Gets the request path after the context path.
|
Map<String,String> |
getQueryParams()
Gets the Http request query params.
|
String |
getQueryParamString()
Gets the Http request query param string.
|
String |
getReasonPhrase()
Gets the Http response reason phrase.
|
org.springframework.http.HttpMethod |
getRequestMethod()
Gets the Http request method.
|
org.springframework.http.HttpStatus |
getStatusCode()
Gets the Http response status code.
|
String |
getUri()
Gets the Http request request uri.
|
String |
getVersion()
Gets the Http version.
|
HttpMessage |
header(String headerName,
Object headerValue)
Sets new header name value pair.
|
HttpMessage |
method(org.springframework.http.HttpMethod method)
Sets the Http request method header.
|
HttpMessage |
path(String path)
Sets request path that is dynamically added to base uri.
|
HttpMessage |
queryParam(String name)
Sets a new Http request query param.
|
HttpMessage |
queryParam(String name,
String value)
Sets a new Http request query param.
|
HttpMessage |
queryParams(String queryParamString)
Sets the Http request query params query String.
|
HttpMessage |
reasonPhrase(String reasonPhrase)
Sets the Http response reason phrase header.
|
void |
setCookies(javax.servlet.http.Cookie[] cookies)
Sets the cookies.
|
HttpMessage |
setHeader(String headerName,
Object headerValue) |
HttpMessage |
status(org.springframework.http.HttpStatus statusCode)
Sets the Http response status code.
|
HttpMessage |
statusCode(Integer statusCode)
Sets the Http response status code header.
|
HttpMessage |
uri(String requestUri)
Sets the Http request request uri header.
|
HttpMessage |
version(String version)
Sets the Http version header.
|
getHeader, getHeaderData, getHeaders, getId, getName, getPayload, getPayload, getTimestamp, removeHeader, setName, setPayload, toStringpublic HttpMessage()
public HttpMessage(Message message)
message - The base message for the copy operationpublic HttpMessage(Object payload)
payload - The payload for the message to setpublic HttpMessage method(org.springframework.http.HttpMethod method)
method - The Http method header to usepublic HttpMessage version(String version)
version - The http version header value to usepublic HttpMessage status(org.springframework.http.HttpStatus statusCode)
statusCode - The status code header to respond withpublic HttpMessage statusCode(Integer statusCode)
statusCode - The status code header value to respond withpublic HttpMessage reasonPhrase(String reasonPhrase)
reasonPhrase - The reason phrase header value to usepublic HttpMessage uri(String requestUri)
requestUri - The request uri header value to usepublic HttpMessage contentType(String contentType)
contentType - The content type header value to usepublic HttpMessage accept(String accept)
accept - The accept header value to setpublic HttpMessage contextPath(String contextPath)
contextPath - The context path header value to usepublic HttpMessage queryParams(String queryParamString)
queryParamString - The query parameter string to evaluatepublic HttpMessage queryParam(String name)
name - The name of the request query parameterpublic HttpMessage queryParam(String name, String value)
name - The name of the request query parametervalue - The value of the request query parameterpublic HttpMessage path(String path)
path - The part of the path to addpublic HttpMessage header(String headerName, Object headerValue)
headerName - The name of the headerheaderValue - The value of the headerpublic HttpMessage setHeader(String headerName, Object headerValue)
setHeader in interface MessagesetHeader in class DefaultMessagepublic HttpMessage addHeaderData(String headerData)
addHeaderData in interface MessageaddHeaderData in class DefaultMessagepublic org.springframework.http.HttpMethod getRequestMethod()
public String getUri()
public String getContextPath()
public String getContentType()
public String getAccept()
public Map<String,String> getQueryParams()
public String getQueryParamString()
public org.springframework.http.HttpStatus getStatusCode()
public String getReasonPhrase()
public String getVersion()
public String getPath()
public List<javax.servlet.http.Cookie> getCookies()
public void setCookies(javax.servlet.http.Cookie[] cookies)
cookies - The cookies to setpublic HttpMessage cookie(javax.servlet.http.Cookie cookie)
cookie - The Cookie to setpublic static HttpMessage fromRequestData(String requestData)
requestData - The request dump to parsepublic static HttpMessage fromResponseData(String responseData)
responseData - The response dump to parseCopyright © 2008–2019 ConSol Software GmbH. All rights reserved.