Package org.projectnessie.client.http
Class HttpRequest
java.lang.Object
org.projectnessie.client.http.HttpRequest
- All Implemented Interfaces:
ExecutableHttpRequest<HttpClientException,RuntimeException>
- Direct Known Subclasses:
BaseHttpRequest
public abstract class HttpRequest
extends Object
implements ExecutableHttpRequest<HttpClientException,RuntimeException>
Class to hold an ongoing HTTP request and its parameters/filters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected HttpAuthenticationprotected booleanprotected final HttpRuntimeConfigprotected Stringprotected final HttpHeadersprotected final UriBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the authentication to use for this request.contentsType(String contentType) delete()abstract HttpResponseexecuteRequest(HttpClient.Method method, Object body) get()Sets the content-type to application/x-www-form-urlencoded.queryParam(String name, Integer value) queryParam(String name, String value) resolveTemplate(String name, String value) <E extends Exception>
ExecutableHttpRequest<E, RuntimeException> <E1 extends Exception,E2 extends Exception>
ExecutableHttpRequest<E1, E2>
-
Field Details
-
config
-
uriBuilder
-
headers
-
contentsType
-
accept
-
auth
-
bypassFilters
protected boolean bypassFilters
-
-
Constructor Details
-
HttpRequest
-
-
Method Details
-
authentication
Sets the authentication to use for this request. A non-null value will override the authentication object set on theHttpClientlevel, if any.The passed authentication object will be started when this request is prepared, and will be closed immediately after this request is executed.
- Parameters:
auth- the authentication to use- Returns:
- this request
-
contentsType
-
accept
-
path
-
queryParam
-
queryParam
-
header
-
executeRequest
public abstract HttpResponse executeRequest(HttpClient.Method method, Object body) throws HttpClientException - Throws:
HttpClientException
-
get
- Specified by:
getin interfaceExecutableHttpRequest<HttpClientException,RuntimeException> - Throws:
HttpClientException
-
delete
- Specified by:
deletein interfaceExecutableHttpRequest<HttpClientException,RuntimeException> - Throws:
HttpClientException
-
post
- Specified by:
postin interfaceExecutableHttpRequest<HttpClientException,RuntimeException> - Throws:
HttpClientException
-
put
- Specified by:
putin interfaceExecutableHttpRequest<HttpClientException,RuntimeException> - Throws:
HttpClientException
-
postForm
Sets the content-type to application/x-www-form-urlencoded. The provided body will be automatically encoded as form data. This is a convenience method forcontentsType("application/x-www-form-urlencoded").post(obj). The request should be sent withpost(Object). -
resolveTemplate
-
unwrap
-
unwrap
public <E1 extends Exception,E2 extends Exception> ExecutableHttpRequest<E1,E2> unwrap(Class<E1> ex1, Class<E2> ex2)
-