public final class HttpRequest extends Object
public static HttpRequest create(HttpClient httpClient)
httpClient
- public static HttpRequest url(String url)
url
- public static HttpRequest url(String url, long connectionTimeout, long readTimeout)
url
- connectionTimeout
- readTimeout
- public HttpRequest basicAuth(String user, Object password)
user
- password
- public HttpRequest header(String name, Object value)
name
- value
- public HttpRequest headers(String name1, Object value1, String name2, Object value2)
name1
- value1
- name2
- value2
- public HttpRequest headers(String name1, Object value1, String name2, Object value2, String name3, Object value3)
name1
- value1
- name2
- value2
- name3
- value3
- public HttpRequest headers(Map<String,?> headers)
headers
- public HttpRequest headers(HttpHeaders headers)
headers
- public String get() throws UncheckedIOException
UncheckedIOException
- the unchecked IO exceptionpublic <T> T get(Class<T> resultClass) throws UncheckedIOException
T
- resultClass
- UncheckedIOException
- the unchecked IO exceptionpublic <T> T get(Class<T> resultClass, Object query) throws UncheckedIOException
T
- resultClass
- query
- UncheckedIOException
- the unchecked IO exceptionpublic <T> T post(Class<T> resultClass, Object body) throws UncheckedIOException
T
- resultClass
- body
- UncheckedIOException
- the unchecked IO exceptionpublic String put(Object body) throws UncheckedIOException
body
- UncheckedIOException
- the unchecked IO exceptionpublic <T> T put(Class<T> resultClass, Object body) throws UncheckedIOException
T
- resultClass
- body
- UncheckedIOException
- the unchecked IO exceptionpublic String delete() throws UncheckedIOException
UncheckedIOException
- the unchecked IO exceptionpublic <T> T delete(Class<T> resultClass) throws UncheckedIOException
T
- resultClass
- UncheckedIOException
- the unchecked IO exceptionpublic String delete(Object query) throws UncheckedIOException
query
- UncheckedIOException
- the unchecked IO exceptionpublic <T> T delete(Class<T> resultClass, Object query) throws UncheckedIOException
T
- resultClass
- query
- UncheckedIOException
- the unchecked IO exceptionpublic String execute(HttpMethod httpMethod) throws UncheckedIOException
httpMethod
- UncheckedIOException
public <T> T execute(Class<T> resultClass, HttpMethod httpMethod) throws UncheckedIOException
T
- resultClass
- httpMethod
- UncheckedIOException
- the unchecked IO exceptionpublic String execute(HttpMethod httpMethod, Object body) throws UncheckedIOException
httpMethod
- body
- UncheckedIOException
public <T> T execute(Class<T> resultClass, HttpMethod httpMethod, Object body) throws UncheckedIOException
T
- resultClass
- httpMethod
- body
- UncheckedIOException
- the unchecked IO exceptionpublic void execute(File output, HttpMethod httpMethod, Object body) throws UncheckedIOException
UncheckedIOException
public void execute(OutputStream output, HttpMethod httpMethod, Object body) throws UncheckedIOException
UncheckedIOException
public void execute(Writer output, HttpMethod httpMethod, Object body) throws UncheckedIOException
UncheckedIOException
public ContinuableFuture<String> asyncGet()
public <T> ContinuableFuture<T> asyncGet(Class<T> resultClass)
T
- resultClass
- public ContinuableFuture<String> asyncGet(Object query)
query
- public <T> ContinuableFuture<T> asyncGet(Class<T> resultClass, Object query)
T
- resultClass
- query
- public ContinuableFuture<String> asyncPost(Object body)
body
- public <T> ContinuableFuture<T> asyncPost(Class<T> resultClass, Object body)
T
- resultClass
- body
- public ContinuableFuture<String> asyncPut(Object body)
body
- public <T> ContinuableFuture<T> asyncPut(Class<T> resultClass, Object body)
T
- resultClass
- body
- public ContinuableFuture<String> asyncDelete()
public <T> ContinuableFuture<T> asyncDelete(Class<T> resultClass)
T
- resultClass
- public ContinuableFuture<String> asyncDelete(Object query)
query
- public <T> ContinuableFuture<T> asyncDelete(Class<T> resultClass, Object query)
T
- resultClass
- query
- public ContinuableFuture<String> asyncExecute(HttpMethod httpMethod)
public <T> ContinuableFuture<T> asyncExecute(Class<T> resultClass, HttpMethod httpMethod)
T
- resultClass
- public ContinuableFuture<String> asyncExecute(HttpMethod httpMethod, Object body)
body
- public <T> ContinuableFuture<T> asyncExecute(Class<T> resultClass, HttpMethod httpMethod, Object body)
T
- resultClass
- body
- public ContinuableFuture<Void> asyncExecute(File output, HttpMethod httpMethod, Object body)
public ContinuableFuture<Void> asyncExecute(OutputStream output, HttpMethod httpMethod, Object body)
public ContinuableFuture<Void> asyncExecute(Writer output, HttpMethod httpMethod, Object body)
public HttpRequest connectionTimeout(int connectionTimeout)
public HttpRequest readTimeout(int readTimeout)
public HttpRequest useCaches(boolean useCaches)
Copyright © 2021. All rights reserved.