public final class HTTPRequest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HTTPRequest.Method |
public HTTPRequest header(String name, String value)
name - the name of the headervalue - the value of the headerpublic HTTPRequest queryParam(String name, String value)
name - the name of the query parametervalue - the value of the query parameterpublic HTTPRequest pathParam(String name, String value)
name - the name of the path parametervalue - the value of the path parameterpublic HTTPRequest timeout(int newTimeout)
newTimeout - Timeout in mspublic HTTPRequest followRedirect(boolean follow)
follow - true to automatically follow redirects; false otherwisepublic HTTPRequest retry(int maxRetries, Retryable retryable, WaitStrategy waitStrategy)
maxRetries - Maximum number of retriesretryable - Function to determine if call should be retriedwaitStrategy - Function to calculate the time to wait between two retriespublic HTTPRequest retry()
public HTTPRequest userAgent(String agent)
agent - the user agent string to usepublic HTTPRequest contentType(String type)
type - the Content-Typepublic HTTPRequest auth(String authString)
authString - the Authorization headerpublic HTTPRequest authBasic(String user, String password)
user - the usernamepassword - the passwordpublic HTTPRequest authBearer(String accessToken)
accessToken - the OAuth2 Bearer access tokenpublic HTTPRequest accept(String type)
type - the Accept typepublic HTTPRequest body(String bodyString)
bodyString - the body entitypublic HTTPRequest form(Map<String,String> form)
form - the form contentpublic HTTPResponse get()
HTTPResponsepublic HTTPResponse put()
HTTPResponsepublic HTTPResponse patch()
HTTPResponsepublic HTTPResponse post()
HTTPResponsepublic HTTPResponse delete()
HTTPResponsepublic HTTPResponse options()
HTTPResponsepublic HTTPResponse head()
HTTPResponsepublic void getAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void getAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackpublic void putAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void putAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackpublic void patchAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void patchAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackpublic void postAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void postAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackpublic void deleteAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void deleteAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackpublic void optionsAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void optionsAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackpublic void headAsync(HTTPResponseCallback callback)
callback - HTTPResponseCallbackpublic void headAsync(Executor executor, HTTPResponseCallback callback)
executor - Thread poolcallback - HTTPResponseCallbackCopyright © 2012–2018 Taimos GmbH. All rights reserved.