Clients -
http :
HttpClient
Provides the HTTP actions for interacting with an HTTP server. Apart from the standard HTTP methods, forward()
and execute()
functions are provided. More complex and specific endpoint types can be created by wrapping this
generic HTTP actions implementation.
Constructor
__init
(string url, ClientEndpointConfig? config)
- url string
- config ClientEndpointConfig? ()
Remote Methods
The post()
function can be used to send HTTP POST requests to HTTP endpoints.
The head()
function can be used to send HTTP HEAD requests to HTTP endpoints.
The put()
function can be used to send HTTP PUT requests to HTTP endpoints.
Invokes an HTTP call with the specified HTTP verb.
The patch()
function can be used to send HTTP PATCH requests to HTTP endpoints.
The delete()
function can be used to send HTTP DELETE requests to HTTP endpoints.
The get()
function can be used to send HTTP GET requests to HTTP endpoints.
The options()
function can be used to send HTTP OPTIONS requests to HTTP endpoints.
The forward()
function can be used to invoke an HTTP call with inbound request's HTTP verb
Submits an HTTP request to a service with the specified HTTP verb.
The 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.
Retrieves the Response
for a previously submitted request.
Checks whether a PushPromise
exists for a previously submitted request.
Retrieves the next available PushPromise
for a previously submitted request.
Retrieves the promised server push Response
message.
Rejects a PushPromise
. When a PushPromise
is rejected, there is no chance of fetching a promised
response using the rejected promise.
Fields
- config ClientEndpointConfig {}
-
The configurations associated with the HttpClient
- url string
-
The URL of the remote HTTP endpoint
The post()
function can be used to send HTTP POST requests to HTTP endpoints.
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[]
The head()
function can be used to send HTTP HEAD requests to HTTP endpoints.
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[]
The put()
function can be used to send HTTP PUT requests to HTTP endpoints.
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[]
Invokes an HTTP call with the specified HTTP verb.
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
ormime:Entity[]
The patch()
function can be used to send HTTP PATCH requests to HTTP endpoints.
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[]
The delete()
function can be used to send HTTP DELETE requests to HTTP endpoints.
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[]
The get()
function can be used to send HTTP GET requests to HTTP endpoints.
Parameters
- path string
-
Request path
- message RequestMessage - ()
-
An optional HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
The options()
function can be used to send HTTP OPTIONS requests to HTTP endpoints.
Parameters
- path string
-
Request path
- message RequestMessage - ()
-
An optional HTTP outbound request message or any payload of type
string
,xml
,json
,byte[]
,io:ReadableByteChannel
ormime:Entity[]
The forward()
function can be used to invoke an HTTP call with inbound request's HTTP verb
Submits an HTTP request to a service with the specified HTTP verb.
The 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 | error) An
HttpFuture
that represents an asynchronous service invocation, or anerror
if the submission fails
Retrieves the Response
for a previously submitted request.
Parameters
- httpFuture HttpFuture
-
The
HttpFuture
related to a previous asynchronous invocation
Checks whether a PushPromise
exists for a previously submitted request.
Parameters
- httpFuture HttpFuture
-
The
HttpFuture
relates to a previous asynchronous invocation
-
Return Type
(boolean) A
boolean
that represents whether aPushPromise
exists
Retrieves the next available PushPromise
for a previously submitted request.
Parameters
- httpFuture HttpFuture
-
The
HttpFuture
relates to a previous asynchronous invocation
-
Return Type
(PushPromise | error) An HTTP Push Promise message, or an
error
if the invocation fails
Retrieves the promised server push Response
message.
Parameters
- promise PushPromise
-
The related
PushPromise
Rejects a PushPromise
. When a 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