Client: RedirectClient

Provides redirect functionality for HTTP client remote functions.

Remote Methods

get

If the received response for the RedirectClient.get() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.get() function.

post

If the received response for the RedirectClient.post() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.post() function.

head

If the received response for the RedirectClient.head() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.head() function.

put

If the received response for the RedirectClient.put() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.put() function.

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.

patch

If the received response for the RedirectClient.patch() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.patch() function.

delete

If the received response for the RedirectClient.delete() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.delete() function.

options

If the received response for the RedirectClient.options() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.options() function.

submit

Submits an HTTP request to a service with the specified HTTP verb.

getResponse

Retrieves the http:Response for a previously-submitted request.

hasPromise

Checks whether an http:PushPromise exists for a previously-submitted request.

getNextPromise

Retrieves the next available http:PushPromise for a previously-submitted request.

getPromisedResponse

Retrieves the promised server push http:Response message.

rejectPromise

Rejects an http:PushPromise.

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

get

function get(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.get() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.get() function.

Parameters

  • message RequestMessage (default ())
  • An optional HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

post

function post(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.post() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.post() function.

Parameters

  • message RequestMessage
  • An HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or the payload (if the targetType is configured) or an http:ClientError if failed to establish the communication with the upstream server or a data binding failure

function head(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.head() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.head() function.

Parameters

  • message RequestMessage (default ())
  • An optional HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

put

function put(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.put() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.put() function.

Parameters

  • message RequestMessage
  • An HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

forward

function forward(string path, Request request) returns Response | ClientError
Isolated Function
Remote Function

The RedirectClient.forward() function is used to invoke an HTTP call with inbound request's HTTP verb.

Parameters

  • request Request
  • An HTTP inbound request message

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

execute

function execute(string httpVerb, string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

The 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

  • message RequestMessage
  • An HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

patch

function patch(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.patch() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.patch() function.

Parameters

  • message RequestMessage
  • An HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

delete

function delete(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.delete() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.delete() function.

Parameters

  • message RequestMessage (default ())
  • An HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

options

function options(string path, RequestMessage message) returns Response | ClientError
Isolated Function
Remote Function

If the received response for the RedirectClient.options() remote function is redirect eligible, redirect will be performed automatically by this RedirectClient.options() function.

Parameters

  • message RequestMessage (default ())
  • An optional HTTP outbound request or any allowed payload

Return Type

(Response | ClientError)

The response or an http:ClientError if failed to establish the communication with the upstream server

submit

function submit(string httpVerb, string path, RequestMessage message) returns HttpFuture | ClientError
Isolated Function
Remote Function

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.

Parameters

  • httpVerb string
  • The HTTP verb value

  • message RequestMessage
  • An HTTP outbound request or any allowed payload

Return Type

(HttpFuture | ClientError)

An http:HttpFuture that represents an asynchronous service invocation or else an http:ClientError if the submission fails

getResponse

function getResponse(HttpFuture httpFuture) returns Response | ClientError
Isolated Function
Remote Function

Retrieves the 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 an http:ClientError if the invocation fails

hasPromise

function hasPromise(HttpFuture httpFuture) returns (boolean)
Isolated Function
Remote Function

Checks whether an 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 an http:PushPromise exists

getNextPromise

function getNextPromise(HttpFuture httpFuture) returns PushPromise | ClientError
Isolated Function
Remote Function

Retrieves the next available 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 an http:ClientError if the invocation fails

getPromisedResponse

function getPromisedResponse(PushPromise promise) returns Response | ClientError
Isolated Function
Remote Function

Retrieves the promised server push http:Response message.

Parameters

Return Type

(Response | ClientError)

A promised http:Response message or else an http:ClientError if the invocation fails

rejectPromise

function rejectPromise(PushPromise promise)
Isolated Function
Remote Function

Rejects an http:PushPromise. When an http:PushPromise is rejected, there is no chance of fetching a promised response using the rejected promise.

Parameters