public static final class HttpRequest.Builder extends Object
Constructor and Description |
---|
Builder() |
Builder(HttpRequest copy) |
Modifier and Type | Method and Description |
---|---|
HttpRequest.Builder |
body(String body,
String contentType)
Set a custom body with the specified content type
|
HttpRequest.Builder |
bodyJson(String body)
Set the JSON body of the request
|
HttpRequest |
build() |
HttpRequest.Builder |
callback(Handler<? super InputStream> callback)
Set the callback where you will be notified when the requests completes successfully or with an error.
|
HttpRequest.Builder |
customHeaders(Map<String,String> customHeaders)
Set custom headers of the request
|
HttpRequest.Builder |
method(String method)
Set the HTTP method.
|
HttpRequest.Builder |
options(Map<String,Object> options)
Set custom options.
|
HttpRequest.Builder |
requestParams(Map<String,Object> requestParams)
Set request params
|
HttpRequest.Builder |
responseDestinationFile(File file)
Set the file where the response will be writen
|
HttpRequest.Builder |
url(String relativeUrl)
Set the relative url to send the request
|
public Builder()
public Builder(HttpRequest copy)
public HttpRequest.Builder url(String relativeUrl)
public HttpRequest.Builder method(String method)
HttpMethod
public HttpRequest.Builder bodyJson(String body)
public HttpRequest.Builder body(String body, String contentType)
public HttpRequest.Builder requestParams(Map<String,Object> requestParams)
public HttpRequest.Builder customHeaders(Map<String,String> customHeaders)
public HttpRequest.Builder options(Map<String,Object> options)
HttpOption
public HttpRequest.Builder responseDestinationFile(File file)
file
- public HttpRequest.Builder callback(Handler<? super InputStream> callback)
public HttpRequest build()