Package org.projectnessie.client.http
Class RequestContext
- java.lang.Object
-
- org.projectnessie.client.http.RequestContext
-
public class RequestContext extends Object
Context containing all important info about a request.
-
-
Constructor Summary
Constructors Constructor Description RequestContext(Map<String,Set<String>> headers, URI uri, HttpClient.Method method, Object body)Construct a request context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResponseCallback(BiConsumer<ResponseContext,Exception> responseCallback)Adds a callback to be called when the request has finished.Optional<Object>getBody()Map<String,Set<String>>getHeaders()HttpClient.MethodgetMethod()URIgetUri()voidputHeader(String name, String value)
-
-
-
Method Detail
-
getUri
public URI getUri()
-
getMethod
public HttpClient.Method getMethod()
-
addResponseCallback
public void addResponseCallback(BiConsumer<ResponseContext,Exception> responseCallback)
Adds a callback to be called when the request has finished. TheresponseCallbackconsumeris called with a non-nullResponseContext, if the HTTP request technically succeeded. The TheresponseCallbackconsumeris called with a non-nullExceptionobject, if the HTTP request technically failed.- Parameters:
responseCallback- callback that receives either a non-nullResponseContextor a non-nullException.
-
-