public class HttpEntity
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
headers
Lists of headers, key is the type, value is a list of related values
|
protected java.lang.String |
method
The protocol method to call
|
protected int |
statusCode
The status code
|
protected java.lang.String |
type
|
protected java.lang.Object |
value
Message content, can be multiple types
|
| Constructor and Description |
|---|
HttpEntity(java.lang.String theType,
java.lang.String theMethod)
Create a new instance of HttpEntity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String key,
java.lang.String value)
Add a header as a key-value pair.
|
static HttpEntity |
createEntity(java.lang.String type,
java.lang.String method,
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> headers,
java.lang.Object value)
Create an HttpEntity of the correct type as defined by the value type.
|
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
getHeaders()
Get a list of all headers.
|
java.lang.String |
getMethod()
Get the protocol method name, Get or Post, for example.
|
int |
getStatusCode()
Get the http status code.
|
java.lang.String |
getType()
Get the communication type, for example
Const.{XMLRPC}. |
java.lang.Object |
getValue()
Get the content value of the entity.
|
boolean |
removeHeaders(java.lang.String key)
Remove all headers of the indicated type.
|
void |
setStatusCode(int theStatusCode)
Set the http status code.
|
void |
setValue(java.lang.Object theValue)
Set the content value of the entity.
|
protected java.lang.String type
protected java.lang.String method
protected java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> headers
protected java.lang.Object value
protected int statusCode
public HttpEntity(java.lang.String theType,
java.lang.String theMethod)
theType - the entity protocol type, not null.theMethod - the protocol method, not null.public java.lang.String getType()
Const.{XMLRPC}.public java.lang.String getMethod()
public void addHeader(java.lang.String key,
java.lang.String value)
key - the header name.value - the header value.public boolean removeHeaders(java.lang.String key)
key - the header name or type.public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getHeaders()
public void setValue(java.lang.Object theValue)
theValue - the value.public java.lang.Object getValue()
public void setStatusCode(int theStatusCode)
theStatusCode - the status code.public int getStatusCode()
public static HttpEntity createEntity(java.lang.String type, java.lang.String method, java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> headers, java.lang.Object value)
type - the communication type.method - the http method.headers - optional headers.value - the content value.