Clients -
http :
RedirectClient
Provides redirect functionality for HTTP client remote functions.
Constructor
__init
(string url, ClientConfiguration config, FollowRedirects redirectConfig, HttpClient httpClient)
- url string
-
Target service url
- config ClientConfiguration
-
HTTP ClientConfiguration to be used for HTTP client invocation
- redirectConfig FollowRedirects
-
Configurations associated with redirect
- httpClient HttpClient
-
HTTP client for outbound HTTP requests
Remote Methods
forward | The RedirectClient.forward() function is used to invoke an HTTP call with inbound request's HTTP verb.
|
execute | The RedirectClient.execute() sends an HTTP request to a service with the specified HTTP verb. Redirect will be
performed only for HTTP methods.
|
submit | Submits an HTTP request to a service with the specified HTTP verb.
The RedirectClient.submit() function does not give out a Response as the result,
rather it returns an HttpFuture which can be used to do further interactions with the endpoint.
|
Methods
RedirectClient.get()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.get()
function.
RedirectClient.post()
remote function is redirect eligible, redirect will
be performed automaticallyby this RedirectClient.post()
function.
RedirectClient.head()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.head()
function.
RedirectClient.put()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.put()
function.
RedirectClient.patch()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.patch()
function.
RedirectClient.delete()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.delete()
function.
RedirectClient.options()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.options()
function.
http:Response
for a previously-submitted request.
http:PushPromise
exists for a previously-submitted request.
http:PushPromise
for a previously-submitted request.
http:Response
message.
http:PushPromise
.
When an http:PushPromise
is rejected, there is no chance of fetching a promised response using the rejected promise.
Fields
- url string
-
Target service url
- config ClientConfiguration
-
HTTP ClientConfiguration to be used for HTTP client invocation
- redirectConfig FollowRedirects
-
Configurations associated with redirect
- httpClient HttpClient
-
HTTP client for outbound HTTP requests
- currentRedirectCount int (default 0)
-
Current redirect count of the HTTP client
RedirectClient.forward()
function is used to invoke an HTTP call with inbound request's HTTP verb.
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.execute()
sends an HTTP request to a service with the specified HTTP verb. Redirect will be
performed only for HTTP methods.
Parameters
- httpVerb string
-
The HTTP verb value
- path string
-
Resource path
- message RequestMessage
-
An HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.submit()
function does not give out a Response
as the result,
rather it returns an HttpFuture
which can be used to do further interactions with the endpoint.
Parameters
- httpVerb string
-
The HTTP verb value
- path string
-
The resource path
- message RequestMessage
-
An HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(HttpFuture | ClientError) An
http:HttpFuture
that represents an asynchronous service invocation or else anhttp:ClientError
if the submission fails
RedirectClient.get()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.get()
function.
Parameters
- path string
-
Resource path
- message RequestMessage (default ())
-
An optional HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.post()
remote function is redirect eligible, redirect will
be performed automaticallyby this RedirectClient.post()
function.
Parameters
- path string
-
Resource path
- message RequestMessage
-
An HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
, ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.head()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.head()
function.
Parameters
- path string
-
Resource path
- message RequestMessage (default ())
-
An optional HTTP outbound request message or or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
, ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.put()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.put()
function.
Parameters
- path string
-
Resource path
- message RequestMessage
-
An HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.patch()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.patch()
function.
Parameters
- path string
-
Resource path
- message RequestMessage
-
An HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.delete()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.delete()
function.
Parameters
- path string
-
Resource path
- message RequestMessage (default ())
-
An HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
RedirectClient.options()
remote function is redirect eligible, redirect will be
performed automatically by this RedirectClient.options()
function.
Parameters
- path string
-
Resource path
- message RequestMessage (default ())
-
An optional HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
http:Response
for a previously-submitted request.
Parameters
- httpFuture HttpFuture
-
The
http:HttpFuture
related to a previous asynchronous invocation
-
Return Type
(Response | ClientError) An
http:Response
message or else anhttp:ClientError
if the invocation fails
http:PushPromise
exists for a previously-submitted request.
Parameters
- httpFuture HttpFuture
-
The
HttpFuture
relates to a previous asynchronous invocation
-
Return Type
(boolean) A
boolean
, which represents whether anhttp:PushPromise
exists
http:PushPromise
for a previously-submitted request.
Parameters
- httpFuture HttpFuture
-
The
http:HttpFuture
related to a previous asynchronous invocation
-
Return Type
(PushPromise | ClientError) An
http:PushPromise
message or else anhttp:ClientError
if the invocation fails
http:Response
message.
Parameters
- promise PushPromise
-
The related
http:PushPromise
-
Return Type
(Response | ClientError) A promised
http:Response
message or else anhttp:ClientError
if the invocation fails
http:PushPromise
.
When an http:PushPromise
is rejected, there is no chance of fetching a promised response using the rejected promise.
Parameters
- promise PushPromise
-
The Push Promise to be rejected