public abstract class RestData extends Object
RestRequest and RestResponse.| Modifier and Type | Class and Description |
|---|---|
static class |
RestData.Header
Holds an Http Header.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENCODING |
static String |
LINE_SEPARATOR |
| Constructor and Description |
|---|
RestData() |
| Modifier and Type | Method and Description |
|---|---|
RestData |
addHeader(String name,
String value)
Adds an HTTP header to the current list.
|
RestData |
addHeaders(List<RestData.Header> headers)
Adds a collection of HTTP headers to the current list of headers.
|
RestData |
addHeaders(Map<String,String> headers)
Adds a collection of HTTP headers to the current list of headers.
|
String |
getBody() |
String |
getCharset() |
String |
getContentLength() |
String |
getContentType() |
List<RestData.Header> |
getHeader(String name) |
List<RestData.Header> |
getHeaders() |
String |
getHeaderValue(String name) |
byte[] |
getRawBody() |
String |
getResource() |
Long |
getTransactionId()
A transaction Id is a unique long for this transaction.
|
RestData |
setBody(String body) |
RestData |
setRawBody(byte[] rawBody) |
RestData |
setResource(String resource) |
RestData |
setTransactionId(Long txId) |
String |
toString()
A visually easy to read representation of this
RestData. |
public static final String LINE_SEPARATOR
public static String DEFAULT_ENCODING
public String getBody()
public byte[] getRawBody()
public RestData setRawBody(byte[] rawBody)
rawBody - the bodypublic String getResource()
/resource-type) for this
request/responsepublic RestData setResource(String resource)
resource - the resource typepublic RestData setTransactionId(Long txId)
txId - the transaction idpublic Long getTransactionId()
public List<RestData.Header> getHeaders()
public List<RestData.Header> getHeader(String name)
name - the header namepublic RestData addHeader(String name, String value)
name - the header namevalue - the header valuepublic RestData addHeaders(Map<String,String> headers)
headers - the collection of headerspublic RestData addHeaders(List<RestData.Header> headers)
headers - the list of headerspublic String toString()
RestData.
It tryes to match the typical Http Request/Responsepublic String getContentType()
public String getCharset()
public String getContentLength()
Copyright © 2016 smartrics. All Rights Reserved.