public abstract class BaseRequest extends Object
| Modifier and Type | Field and Description |
|---|---|
protected HttpRequest |
httpRequest
The underlying HTTP Request.
|
protected static String |
UTF_8
The UTF-8 charset.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BaseRequest()
Creates a base request.
|
protected |
BaseRequest(HttpRequest httpRequest)
Creates a base request form the given HTTP Request.
|
| Modifier and Type | Method and Description |
|---|---|
HttpResponse<InputStream> |
asBinary()
Gets the request results as binary.
|
Future<HttpResponse<InputStream>> |
asBinaryAsync()
Gets the request results as binary.
|
Future<HttpResponse<InputStream>> |
asBinaryAsync(Callback<InputStream> callback)
Gets the request results as binary.
|
HttpResponse<org.jsoup.nodes.Document> |
asHtml()
Gets the request results as HTML.
|
HttpResponse<com.fasterxml.jackson.databind.JsonNode> |
asJson()
Gets the request results as JSON.
|
Future<HttpResponse<com.fasterxml.jackson.databind.JsonNode>> |
asJsonAsync()
Gets the request results as JSON.
|
Future<HttpResponse<com.fasterxml.jackson.databind.JsonNode>> |
asJsonAsync(Callback<com.fasterxml.jackson.databind.JsonNode> callback)
Gets the request results as String.
|
HttpResponse<String> |
asString()
Gets the request results as String.
|
Future<HttpResponse<String>> |
asStringAsync()
Gets the request results as String.
|
Future<HttpResponse<String>> |
asStringAsync(Callback<String> callback)
Gets the request results as String.
|
protected static final String UTF_8
protected HttpRequest httpRequest
protected BaseRequest(HttpRequest httpRequest)
httpRequest - the requestprotected BaseRequest()
public HttpResponse<String> asString() throws Exception
Exception - if the request failedpublic Future<HttpResponse<String>> asStringAsync()
public Future<HttpResponse<String>> asStringAsync(Callback<String> callback)
callback - the callback invoked with the resulting String.public HttpResponse<com.fasterxml.jackson.databind.JsonNode> asJson() throws Exception
Exception - if the request failedpublic HttpResponse<org.jsoup.nodes.Document> asHtml() throws Exception
Exception - if the request failedpublic Future<HttpResponse<com.fasterxml.jackson.databind.JsonNode>> asJsonAsync()
public Future<HttpResponse<com.fasterxml.jackson.databind.JsonNode>> asJsonAsync(Callback<com.fasterxml.jackson.databind.JsonNode> callback)
callback - the callback invoked with the resulting String.public HttpResponse<InputStream> asBinary() throws Exception
Exceptionpublic Future<HttpResponse<InputStream>> asBinaryAsync()
public Future<HttpResponse<InputStream>> asBinaryAsync(Callback<InputStream> callback)
callback - the callback invoked with the resulting String.Copyright © 2013–2015 Wisdom Framework. All rights reserved.