|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.api.net.HttpMessage
public abstract class HttpMessage
Basic details of a HTTP message (request or response)
| Field Summary | |
|---|---|
protected LinkedHashMap<String,String> |
cookies
|
protected LinkedHashMap<String,List<String>> |
headers
|
protected RequestMethod |
requestMethod
|
| Constructor Summary | |
|---|---|
HttpMessage()
|
|
| Method Summary | |
|---|---|
Map<String,String> |
getCookies()
Returns the cookies to be added to the Cookie HTTP header. |
String |
getCookieValue(String name)
Returns the value associated with a given cookie name |
Map<String,String> |
getHeaders()
Returns the headers and their corresponding values in this HTTP message. |
String |
getHeaderValue(String header)
Returns the value(s) currently defined for a given header. |
List<String> |
getHeaderValues(String header)
Returns the list of values currently defined for a given header. |
Map<String,List<String>> |
getMultiHeaders()
Returns the headers and their corresponding values in this HTTP message. |
String |
getReferrer()
Returns the current Referer request header that identifies the address of the web-page
that linked to the resource being requested. |
RequestMethod |
getRequestMethod()
Returns the RequestMethod to be used by this request. |
String |
getUserAgent()
Returns the current User-Agent request header, which identifies the user agent originating the request. |
boolean |
hasCookie(String name)
Verifies whether a cookie has been set |
boolean |
hasHeader(String name)
Checks whether this HTTP message has a given header defined. |
boolean |
hasHeaderWithValue(String name,
String value)
Verifies whether a given header has a value |
boolean |
isKeepAliveEnabled()
Returns a flag indicating whether the connection is meant to be reused for further requests (i.e. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RequestMethod requestMethod
protected LinkedHashMap<String,List<String>> headers
protected LinkedHashMap<String,String> cookies
| Constructor Detail |
|---|
public HttpMessage()
| Method Detail |
|---|
public final Map<String,String> getHeaders()
getMultiHeaders() to obtain the multiple values in a list.
public final boolean hasHeader(String name)
name - the header name to look for
true if the given header exists in this HTTP message, otherwise falsepublic final Map<String,List<String>> getMultiHeaders()
getHeaders()
to obtain them as a comma separated sequence
public final String getHeaderValue(String header)
String will have them separated by a comma.
Use getHeaderValues(String) to obtain the header values as a List
header - the header name whose value(s) will be returned.
null if the header is not definedpublic final List<String> getHeaderValues(String header)
getHeaderValue(String) to obtain the header values as a comma delimited String
header - the header name whose value(s) will be returned.
null if the header is not definedpublic final Map<String,String> getCookies()
Cookie HTTP header.
public final RequestMethod getRequestMethod()
RequestMethod to be used by this request.
The method type identifies an action to be performed on the identified (remote) resource.
Defaults to RequestMethod.GET
public final boolean isKeepAliveEnabled()
Connection request header is set to close. If the Connection
header is not set, it is assumed that the connection is persistent, and this method will return true.
public final String getUserAgent()
User-Agent request header, which identifies the user agent originating the request.
User-Agent headerpublic final String getReferrer()
Referer request header that identifies the address of the web-page
that linked to the resource being requested.
Referer headerpublic final String getCookieValue(String name)
name - the name that identifies a cookie
public final boolean hasCookie(String name)
name - the name that identifies a cookie
true if a cookie with the given name has been defined, otherwise false
public final boolean hasHeaderWithValue(String name,
String value)
name - the header name whose values will be verifiedvalue - the value to find among the possible multiple values associated with the given header
true if the given value is associated with the given header name, otherwise false
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||