Object - http : CookieClient

Provides the cookie functionality across HTTP client actions.

Constructor

__init

(string url, ClientConfiguration config, CookieConfig cookieConfig, HttpClient httpClient, CookieStore? cookieStore)

  • url string
  • Target service URL

  • config ClientConfiguration
  • HTTP Client Configuration to be used for the HTTP client invocation

  • cookieConfig CookieConfig
  • Configurations associated with the cookies

  • httpClient HttpClient
  • HTTP client for outbound HTTP requests

  • cookieStore CookieStore?
  • Stores the cookies of the client

Methods

The CookieClient.

The CookieClient.

The CookieClient.

The CookieClient.

The CookieClient.

The CookieClient.

The CookieClient.

The CookieClient.

The CookieClient.

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

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

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

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

Retrieves the promised server push http:Response message.

Rejects an http:PushPromise.

Fields

  • url string
  • Target service URL

  • config ClientConfiguration
  • HTTP Client Configuration to be used for the HTTP client invocation

  • cookieConfig CookieConfig
  • Configurations associated with the cookies

  • httpClient HttpClient
  • HTTP client for outbound HTTP requests

  • cookieStore CookieStore? (default ())
  • Stores the cookies of the client

get

(string path, RequestMessage message)

returns Response | ClientError

The CookieClient.get() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Request path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

post

(string path, RequestMessage message)

returns Response | ClientError

The CookieClient.post() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

The CookieClient.head() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

put

(string path, RequestMessage message)

returns Response | ClientError

The CookieClient.put() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

forward

(string path, Request request)

returns Response | ClientError

The CookieClient.forward() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Request path

  • request Request
  • An HTTP inbound request message

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

execute

(string httpVerb, string path, RequestMessage message)

returns Response | ClientError

The CookieClient.execute() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • httpVerb string
  • 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 or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

patch

(string path, RequestMessage message)

returns Response | ClientError

The CookieClient.patch() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

delete

(string path, RequestMessage message)

returns Response | ClientError

The CookieClient.delete() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

options

(string path, RequestMessage message)

returns Response | ClientError

The CookieClient.options() function wraps the underlying HTTP remote functions in a way to provide the cookie functionality for a given endpoint.

Parameters

  • path string
  • Request path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response for the request or an http:ClientError if failed to establish communication with the upstream server

submit

(string httpVerb, string path, RequestMessage message)

returns HttpFuture | ClientError

Submits an HTTP request to a service with the specified HTTP verb. The CookieClient.submit() function does not produce 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 or mime:Entity[]

  • Return Type

    (HttpFuture | ClientError)
  • An HttpFuture, which represents an asynchronous service invocation or else an http:ClientError if the submission fails

getResponse

(HttpFuture httpFuture)

returns Response | ClientError

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

Parameters

  • httpFuture HttpFuture
  • The http:HttpFuture relates to a previous asynchronous invocation

  • Return Type

    (Response | ClientError)
  • An HTTP response message or else an http:ClientError if the invocation fails

hasPromise

(HttpFuture httpFuture)

returns boolean

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

Parameters

  • httpFuture HttpFuture
  • The http:HttpFuture related to a previous asynchronous invocation

  • Return Type

    (boolean)
  • A boolean, which represents whether an http:PushPromise exists

getNextPromise

(HttpFuture httpFuture)

returns PushPromise | ClientError

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 Push Promise message or else an http:ClientError if the invocation fails

getPromisedResponse

(PushPromise promise)

returns Response | ClientError

Retrieves the promised server push http:Response message.

Parameters

  • Return Type

    (Response | ClientError)
  • A promised HTTP http:Response message or else an http:ClientError if the invocation fails

rejectPromise

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

Parameters