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 aPromise
representing the pending HTTP response.Promise<Response,NeverThrowsException>
send(Context context, Request request)
Sends an HTTP request and returns aPromise
representing the pending HTTP response.Promise<Response,NeverThrowsException>
sendWithoutClose(Request request)
Sends an HTTP request and returns aPromise
representing the pending HTTP response.Promise<Response,NeverThrowsException>
sendWithoutClose(Context context, Request request)
Sends an HTTP request and returns aPromise
representing the pending HTTP response.
-
-
-
Constructor Detail
-
Client
public Client(Handler handler)
Creates a newClient
which will route HTTP requests to the providedHandler
using aRootContext
allocated during construction when none is provided.- Parameters:
handler
- The HTTP handler.
-
Client
public Client(Handler handler, Context defaultContext)
Creates a newClient
which will route HTTP requests to the providedHandler
using the specifiedContext
if 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 aPromise
representing the pending HTTP response. The givenrequest
is 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 aPromise
representing the pending HTTP response. The givenrequest
is 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 aPromise
representing 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 aPromise
representing the pending HTTP response.- Parameters:
context
- The associated processing context.request
- The HTTP request to send.- Returns:
- A promise representing the pending HTTP response.
-
-