Package org.forgerock.http
Class Client
- java.lang.Object
-
- org.forgerock.http.Client
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<Response,NeverThrowsException>send(Request request)Sends an HTTP request and returns aPromiserepresenting the pending HTTP response.Promise<Response,NeverThrowsException>send(Context context, Request request)Sends an HTTP request and returns aPromiserepresenting the pending HTTP response.Promise<Response,NeverThrowsException>sendWithoutClose(Request request)Sends an HTTP request and returns aPromiserepresenting the pending HTTP response.Promise<Response,NeverThrowsException>sendWithoutClose(Context context, Request request)Sends an HTTP request and returns aPromiserepresenting the pending HTTP response.
-
-
-
Constructor Detail
-
Client
public Client(Handler handler)
Creates a newClientwhich will route HTTP requests to the providedHandlerusing aRootContextallocated during construction when none is provided.- Parameters:
handler- The HTTP handler.
-
Client
public Client(Handler handler, Context defaultContext)
Creates a newClientwhich will route HTTP requests to the providedHandlerusing the specifiedContextif none is provided.- Parameters:
handler- The HTTP handler.defaultContext- The context to pass in with HTTP request when none is provided.
-
-
Method Detail
-
send
public Promise<Response,NeverThrowsException> send(Request request)
Sends an HTTP request and returns aPromiserepresenting the pending HTTP response. The givenrequestis automatically closed on response reception.- Parameters:
request- The HTTP request to send.- Returns:
- A promise representing the pending HTTP response.
-
send
public Promise<Response,NeverThrowsException> send(Context context, Request request)
Sends an HTTP request and returns aPromiserepresenting the pending HTTP response. The givenrequestis automatically closed on response reception.- Parameters:
context- The associated processing context.request- The HTTP request to send.- Returns:
- A promise representing the pending HTTP response.
-
sendWithoutClose
public Promise<Response,NeverThrowsException> sendWithoutClose(Request request)
Sends an HTTP request and returns aPromiserepresenting the pending HTTP response.- Parameters:
request- The HTTP request to send.- Returns:
- A promise representing the pending HTTP response.
-
sendWithoutClose
public Promise<Response,NeverThrowsException> sendWithoutClose(Context context, Request request)
Sends an HTTP request and returns aPromiserepresenting the pending HTTP response.- Parameters:
context- The associated processing context.request- The HTTP request to send.- Returns:
- A promise representing the pending HTTP response.
-
-