HttpRequests.
Make sure to call newRequest() first, then set the request up and obtain it via build() when you are done.
It also offers a few utility methods to deal with content encoding and HTTP headers.
| Modifier and Type | Field and Description |
|---|---|
| public static String | baseUrl
Will be added as a prefix to each URL when |
| public static int | defaultTimeout
Will be set for each new HttpRequest. |
| private Net. | |
| public static Json | json
Will be used for the object serialization in case |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HttpRequestBuilder | basicAuthentication(String username, String password)
Sets the |
| public Net. | |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | formEncodedContent(Map<String, String> content)
Sets the correct |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | jsonContent(Object content)
Sets the correct |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | |
| public HttpRequestBuilder | |
| private void |
| baseUrl | back to summary |
|---|---|
| public static String baseUrl Will be added as a prefix to each URL when | |
| defaultTimeout | back to summary |
|---|---|
| public static int defaultTimeout Will be set for each new HttpRequest. By default set to | |
| httpRequest | back to summary |
|---|---|
| private Net. | |
| json | back to summary |
|---|---|
| public static Json json Will be used for the object serialization in case | |
| HttpRequestBuilder | back to summary |
|---|---|
| public HttpRequestBuilder() | |
| basicAuthentication | back to summary |
|---|---|
| public HttpRequestBuilder basicAuthentication(String username, String password) Sets the | |
| build | back to summary |
|---|---|
| public Net. Returns the | |
| content | back to summary |
|---|---|
public HttpRequestBuilder content(String content)
| |
| content | back to summary |
|---|---|
| public HttpRequestBuilder content(InputStream contentStream, long contentLength) | |
| followRedirects | back to summary |
|---|---|
| public HttpRequestBuilder followRedirects(boolean followRedirects) | |
| formEncodedContent | back to summary |
|---|---|
| public HttpRequestBuilder formEncodedContent(Map<String, String> content) Sets the correct | |
| header | back to summary |
|---|---|
| public HttpRequestBuilder header(String name, String value) | |
| includeCredentials | back to summary |
|---|---|
| public HttpRequestBuilder includeCredentials(boolean includeCredentials) | |
| jsonContent | back to summary |
|---|---|
| public HttpRequestBuilder jsonContent(Object content) Sets the correct | |
| method | back to summary |
|---|---|
public HttpRequestBuilder method(String httpMethod)
| |
| newRequest | back to summary |
|---|---|
| public HttpRequestBuilder newRequest() Initializes the builder and sets it up to build a new | |
| timeout | back to summary |
|---|---|
| public HttpRequestBuilder timeout(int timeOut) If this method is not called, the
| |
| url | back to summary |
|---|---|
| public HttpRequestBuilder url(String url) The
| |
| validate | back to summary |
|---|---|
| private void validate() | |