Package org.forgerock.http
Class Client
java.lang.Object
org.forgerock.http.Client
An HTTP client which forwards requests to a wrapped
Handler
.-
Constructor Summary
ConstructorDescriptionCreates a newClient
which will route HTTP requests to the providedHandler
using aRootContext
allocated during construction when none is provided. -
Method Summary
Modifier and TypeMethodDescriptionSends an HTTP request and returns aPromise
representing the pending HTTP response.Sends an HTTP request and returns aPromise
representing the pending HTTP response.sendWithoutClose
(Request request) Sends an HTTP request and returns aPromise
representing the pending HTTP response.sendWithoutClose
(Context context, Request request) Sends an HTTP request and returns aPromise
representing the pending HTTP response.
-
Constructor Details
-
Client
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
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 Details
-
send
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
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
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
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.
-