-
- All Implemented Interfaces:
public final class HttpRequest.Builder<T extends Object>Builder class for creating HttpRequest instances.
-
-
Constructor Summary
Constructors Constructor Description HttpRequest.Builder(String url)HttpRequest.Builder(URL url)
-
Method Summary
Modifier and Type Method Description final URLgetUrl()final HttpRequest.Builder<T>get()Sets GET method final HttpRequest.Builder<T>post(HttpRequestBody body)Sets POST method with optional request body final HttpRequest.Builder<T>put(HttpRequestBody body)Sets PUT method with optional request body final HttpRequest.Builder<T>delete(HttpRequestBody body)Sets DELETE method with optional request body final HttpRequest.Builder<T>patch(HttpRequestBody body)Sets PATCH method with optional request body final HttpRequest.Builder<T>method(HttpMethod method, ByteArray body, String contentType)final HttpRequest.Builder<T>method(HttpMethod method, Object body)final HttpRequest.Builder<T>method(HttpMethod method, HttpRequestBody requestBody)Generic method for setting HTTP-method with optional request body final HttpRequest.Builder<T>header(String name, String value)Sets request header final HttpRequest.Builder<T>header(String name, Integer value)Sets request header final HttpRequest.Builder<T>header(String name, Boolean value)Sets request header final HttpRequest.Builder<T>headers(HttpHeaders headers)Overwrite request headers final HttpRequest.Builder<T>responseReader(HttpResponseReader<T> responseReader)Sets HTTP-response reader final HttpRequest.Builder<T>tag(String tag)Sets an optional request tag final HttpRequest.Builder<T>userData(Object userData)Sets an optional request user data final HttpRequest<T>build()Creates an HTTP-request instance -
-
Method Detail
-
get
final HttpRequest.Builder<T> get()
Sets GET method
-
post
final HttpRequest.Builder<T> post(HttpRequestBody body)
Sets POST method with optional request body
-
put
final HttpRequest.Builder<T> put(HttpRequestBody body)
Sets PUT method with optional request body
-
delete
final HttpRequest.Builder<T> delete(HttpRequestBody body)
Sets DELETE method with optional request body
-
patch
final HttpRequest.Builder<T> patch(HttpRequestBody body)
Sets PATCH method with optional request body
-
method
final HttpRequest.Builder<T> method(HttpMethod method, ByteArray body, String contentType)
-
method
final HttpRequest.Builder<T> method(HttpMethod method, Object body)
-
method
final HttpRequest.Builder<T> method(HttpMethod method, HttpRequestBody requestBody)
Generic method for setting HTTP-method with optional request body
-
header
final HttpRequest.Builder<T> header(String name, String value)
Sets request header
-
header
final HttpRequest.Builder<T> header(String name, Integer value)
Sets request header
-
header
final HttpRequest.Builder<T> header(String name, Boolean value)
Sets request header
-
headers
final HttpRequest.Builder<T> headers(HttpHeaders headers)
Overwrite request headers
-
responseReader
final HttpRequest.Builder<T> responseReader(HttpResponseReader<T> responseReader)
Sets HTTP-response reader
-
tag
final HttpRequest.Builder<T> tag(String tag)
Sets an optional request tag
-
userData
final HttpRequest.Builder<T> userData(Object userData)
Sets an optional request user data
-
build
final HttpRequest<T> build()
Creates an HTTP-request instance
-
-
-
-