ballerina/http

Overview

This module provides APIs for connecting and interacting with HTTP and HTTP2 endpoints. It facilitates two types of network entry points as the Client and Listener.

Client

The Client is used to connect to and interact with HTTP endpoints. They support connection pooling and can be configured to have a maximum number of active connections that can be made with the remote endpoint. The Client activates connection eviction after a given idle period and also supports follow-redirects so that you do not have to manually handle 3xx HTTP status codes.

Resiliency

The Client handles resilience in multiple ways such as load balancing, circuit breaking, endpoint timeouts, and via a retry mechanism.

Load balancing is used in the round-robin or failover manner.

When a failure occurs in the remote service, the client connections might wait for some time before a timeout occurs. Awaiting requests consume resources in the system. Circuit Breakers are used to trip after a certain number of failed requests to the remote service. Once a circuit breaker trips, it does not allow the client to send requests to the remote service for a period of time.

The Ballerina circuit breaker supports tripping on HTTP error status codes and I/O errors. Failure thresholds can be configured based on a sliding window (e.g., 5 failures within 10 seconds). The Client also supports a retry mechanism that allows it to resend failed requests periodically for a given number of times.

Security

The Client supports Server Name Indication (SNI), Certificate Revocation List (CRL), Online Certificate Status Protocol (OCSP), and OCSP Stapling for SSL/TLS connections. Also, the Client can be configured to send authentication information to the endpoint being invoked. Ballerina has built-in support for Basic authentication, JWT authentication, and OAuth2 authentication.

In addition to that, it supports both HTTP/1.1 and HTTP2 protocols and connection keep-alive, content chunking, HTTP caching, data compression/decompression, response payload binding, and authorization can be highlighted as the features of the Clients.

A Client can be defined using the URL of the remote service that it needs to connect with as shown below:

1http:Client clientEndpoint = check new("https://my-simple-backend.com");

The defined Client endpoint can be used to call a remote service as follows:

1// Send a GET request to the specified endpoint.
2http:Response response = check clientEndpoint->get("/get?id=123");

The payload can be retrieved as the return value from the remote function as follows:

1// Retrieve payload as json.
2json payload = check clientEndpoint->post("/backend/Json", "foo", targetType = json);

Listener

The Listener is the underneath server connector that binds the given IP/Port to the network and it's behavior can be changed using the http:ListenerConfiguration. In HTTP, the http:Service-typed services can be attached to the Listener. The service type precisely describes the syntax for both the service and resource.

A Service represents a collection of network-accessible entry points and can be exposed via a Listener endpoint. A resource represents one such entry point and can have its own path, HTTP methods, body format, consumes and produces content types, CORS headers, etc. In resources, the HTTP method and resource path are mandatory parameters and the String literal and path parameters can be stated as the path. The resource function accepts the http:Caller, http:Request, http:Headers, query parameters, header parameters, and payload parameters as arguments. However, they are optional.

When a Service receives a request, it is dispatched to the best-matched resource.

A Listener endpoint can be defined as follows:

1// Attributes associated with the `Listener` endpoint are defined here.
2listener http:Listener helloWorldEP = new(9090);

Then a Service can be defined and attached to the above Listener endpoint as shown below:

1// By default, Ballerina assumes that the service is to be exposed via HTTP/1.1.
2service /helloWorld on helloWorldEP {
3
4 resource function post [string name](@http:Payload string message) returns string {
5 // Sends the response back to the client along with a string payload.
6 return "Hello, World! I’m " + name + ". " + message;
7 }
8}

Security

Listener endpoints can be exposed via SSL. They support Mutual SSL, Hostname Verification, and Application Layer Protocol Negotiation (ALPN) for HTTP2. Listener endpoints also support Certificate Revocation List (CRL), Online Certificate Status Protocol (OCSP), and OCSP Stapling. Also, The listener can be configured to authenticate and authorize the inbound requests. Ballerina has built-in support for basic authentication, JWT authentication, and OAuth2 authentication.

In addition to that, supports both the HTTP/1.1 and HTTP2 protocols and connection keep-alive, content chunking, HTTP caching, data compression/decompression, payload binding, and authorization can be highlighted as the features of a Service.

Listeners

[1]

Listener

This is used for creating HTTP server endpoints.

Clients

[14]

Caller

The caller actions for responding to client requests.

CircuitBreakerClient

A Circuit Breaker implementation which can be used to gracefully handle network failures.

Client

The HTTP client provides the capability for initiating contact with a remote HTTP service.

ClientOAuth2Handler

Defines the OAuth2 handler for client authentication.

CookieClient

Provides the cookie functionality across HTTP client actions.

FailoverClient

An HTTP client endpoint which provides failover support over multiple HTTP clients.

HttpCachingClient

An HTTP caching client implementation which takes an HttpActions instance and wraps it with an HTTP caching layer.

HttpClient

Lies inside every type of client in the chain holding the native client connector.

HttpSecureClient

Provides secure HTTP remote functions for interacting with HTTP endpoints.

ListenerLdapUserStoreBasicAuthProvider

Defines the LDAP store Basic Auth handler for listener authentication.

ListenerOAuth2Handler

Defines the OAuth2 handler for listener authentication.

LoadBalanceClient

LoadBalanceClient endpoint provides load balancing functionality over multiple HTTP clients.

RedirectClient

Provides redirect functionality for HTTP client remote functions.

RetryClient

Provides the HTTP remote functions for interacting with an HTTP endpoint.

Functions

[5]

authenticateResource

Uses for declarative auth design, where the authentication/authorization decision is taken by reading the auth annotations provided in service/resource and the Authorization header of request.

createHttpCachingClient

Creates an HTTP client capable of caching HTTP responses.

createHttpSecureClient

Creates an HTTP client capable of securing HTTP requests with authentication.

invokeEndpoint

The HEAD remote function implementation of the Circuit Breaker.

parseHeader

Parses the given header value to extract its value and parameter map.

Classes

[60]

ClientBasicAuthHandler

Defines the Basic Auth handler for client authentication.

ClientBearerTokenAuthHandler

Defines the Bearer token auth handler for client authentication.

ClientSelfSignedJwtAuthHandler

Defines the self signed JWT handler for client authentication.

Represents a Cookie.

CookieStore

Represents the cookie store.

CsvPersistentCookieHandler

Represents a default persistent cookie handler, which stores persistent cookies in a CSV file.

Headers

Represents the headers of the inbound request.

HttpCache

Implements a cache for storing HTTP responses.

HttpFuture

Represents a 'future' that returns as a result of an asynchronous HTTP request submission.

ListenerFileUserStoreBasicAuthHandler

Defines the file store Basic Auth handler for listener authentication.

ListenerJwtAuthHandler

Defines the JWT auth handler for listener authentication.

LoadBalancerRoundRobinRule

Implementation of round robin load balancing strategy.

PushPromise

Represents an HTTP/2 PUSH_PROMISE frame.

Request

Represents an HTTP request.

RequestCacheControl

Configures the cache control directives for an http:Request.

Response

Represents an HTTP response.

ResponseCacheControl

Configures cache control directives for an http:Response.

StatusAccepted

Represents the status code of STATUS_ACCEPTED.

StatusBadGateway

Represents the status code of STATUS_BAD_GATEWAY.

StatusBadRequest

Represents the status code of STATUS_BAD_REQUEST.

StatusConflict

Represents the status code of STATUS_CONFLICT.

StatusContinue

Represents the status code of STATUS_CONTINUE.

StatusCreated

Represents the status code of STATUS_CREATED.

StatusExpectationFailed

Represents the status code of STATUS_EXPECTATION_FAILED.

StatusForbidden

Represents the status code of STATUS_FORBIDDEN.

StatusFound

Represents the status code of STATUS_FOUND.

StatusGatewayTimeout

Represents the status code of STATUS_GATEWAY_TIMEOUT.

StatusGone

Represents the status code of STATUS_GONE.

StatusHttpVersionNotSupported

Represents the status code of STATUS_HTTP_VERSION_NOT_SUPPORTED.

StatusInternalServerError

Represents the status code of STATUS_INTERNAL_SERVER_ERROR.

StatusLengthRequired

Represents the status code of STATUS_LENGTH_REQUIRED.

StatusMethodNotAllowed

Represents the status code of STATUS_METHOD_NOT_ALLOWED.

StatusMovedPermanently

Represents the status code of STATUS_MOVED_PERMANENTLY.

StatusMultipleChoices

Represents the status code of STATUS_MULTIPLE_CHOICES.

StatusNoContent

Represents the status code of STATUS_NO_CONTENT.

StatusNonAuthoritativeInformation

Represents the status code of STATUS_NON_AUTHORITATIVE_INFORMATION.

StatusNotAcceptable

Represents the status code of STATUS_NOT_ACCEPTABLE.

StatusNotFound

Represents the status code of STATUS_NOT_FOUND.

StatusNotImplemented

Represents the status code of STATUS_NOT_IMPLEMENTED.

StatusNotModified

Represents the status code of STATUS_NOT_MODIFIED.

StatusOK

Represents the status code of STATUS_OK.

StatusPartialContent

Represents the status code of STATUS_PARTIAL_CONTENT.

StatusPayloadTooLarge

Represents the status code of STATUS_PAYLOAD_TOO_LARGE.

StatusPaymentRequired

Represents the status code of STATUS_PAYMENT_REQUIRED.

StatusPermanentRedirect

Represents the status code of STATUS_PERMANENT_REDIRECT.

StatusPreconditionFailed

Represents the status code of STATUS_PRECONDITION_FAILED.

StatusProxyAuthenticationRequired

Represents the status code of STATUS_PROXY_AUTHENTICATION_REQUIRED.

StatusRangeNotSatisfiable

Represents the status code of STATUS_RANGE_NOT_SATISFIABLE.

StatusRequestHeaderFieldsTooLarge

Represents the status code of STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE.

StatusRequestTimeout

Represents the status code of STATUS_REQUEST_TIMEOUT.

StatusResetContent

Represents the status code of STATUS_RESET_CONTENT.

StatusSeeOther

Represents the status code of STATUS_SEE_OTHER.

StatusServiceUnavailable

Represents the status code of STATUS_SERVICE_UNAVAILABLE.

StatusSwitchingProtocols

Represents the status code of STATUS_SWITCHING_PROTOCOLS.

StatusTemporaryRedirect

Represents the status code of STATUS_TEMPORARY_REDIRECT.

StatusUnauthorized

Represents the status code of STATUS_UNAUTHORIZED.

StatusUnsupportedMediaType

Represents the status code of STATUS_UNSUPPORTED_MEDIA_TYPE.

StatusUpgradeRequired

Represents the status code of STATUS_UPGRADE_REQUIRED.

StatusUriTooLong

Represents the status code of STATUS_URI_TOO_LONG.

StatusUseProxy

Represents the status code of STATUS_USE_PROXY.

Object Types

[5]

ClientObject

The representation of the http Client object type for managing resilient clients.

LoadBalancerRule

LoadBalancerRule object type provides a required abstraction to implement different algorithms.

PersistentCookieHandler

The representation of a persistent cookie handler object type for managing persistent cookies.

Service

The HTTP service type

Status

The Status object creates the distinction for the different response status code types.

Records

[96]

Accepted

The status code response record of Accepted.

BadGateway

The status code response record of BadGateway.

BadRequest

The status code response record of BadRequest.

BearerTokenConfig

Represents token for Bearer token authentication.

Bucket

Represents a discrete sub-part of the time window (Bucket).

CacheConfig

Provides a set of configurations for controlling the caching behaviour of the endpoint.

CertKey

Represents combination of certificate, private key and private key password if encrypted.

CircuitBreakerConfig

Provides a set of configurations for controlling the behaviour of the Circuit Breaker.

CircuitBreakerInferredConfig

Derived set of configurations from the CircuitBreakerConfig.

CircuitHealth

Maintains the health of the Circuit Breaker.

ClientConfiguration

Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.

ClientHttp1Settings

Provides settings related to HTTP/1.x protocol.

ClientHttp2Settings

Provides settings related to HTTP/2 protocol.

ClientSecureSocket

Provides configurations for facilitating secure communication with a remote HTTP endpoint.

CommonClientConfiguration

Common client configurations for the next level clients.

CommonResponse

The common attributed of response status code record type.

CompressionConfig

A record for providing configurations for content compression.

Conflict

The status code response record of Conflict.

Continue

The status code response record of Continue.

CookieConfig

Client configuration for cookies.

CookieOptions

The options to be used when initializing the http:Cookie.

CorsConfig

Configurations for CORS support.

Created

The status code response record of Created.

CredentialsConfig

Represents credentials for Basic Auth authentication.

Detail

Represents the details of an HTTP error.

ExpectationFailed

The status code response record of ExpectationFailed.

FailoverClientConfiguration

Provides a set of HTTP related configurations and failover related configurations.

FileUserStoreConfig

Represents file user store configurations for Basic Auth authentication.

FileUserStoreConfigWithScopes

Represents the auth annotation for file user store configurations with scopes.

FollowRedirects

Provides configurations for controlling the endpoint's behaviour in response to HTTP redirect related responses.

Forbidden

The status code response record of Forbidden.

Found

The status code response record of Found.

GatewayTimeout

The status code response record of GatewayTimeout.

Gone

The status code response record of Gone.

HttpCallerInfo

Configures the typing details type of the Caller resource signature parameter.

HttpHeader

Defines the Header resource signature parameter.

HttpPayload

Defines the Payload resource signature parameter and return parameter.

HttpResourceConfig

Configuration for an HTTP resource.

HttpServiceConfig

Contains the configurations for an HTTP service.

HttpVersionNotSupported

The status code response record of HttpVersionNotSupported.

InternalServerError

The status code response record of InternalServerError.

JwtIssuerConfig

Represents JWT issuer configurations for JWT authentication.

JwtValidatorConfig

Represents JWT validator configurations for JWT authentication.

JwtValidatorConfigWithScopes

Represents the auth annotation for JWT validator configurations with scopes.

LdapUserStoreConfig

Represents LDAP user store configurations for Basic Auth authentication.

LdapUserStoreConfigWithScopes

Represents the auth annotation for LDAP user store configurations with scopes.

LengthRequired

The status code response record of LengthRequired.

ListenerConfiguration

Provides a set of configurations for HTTP service endpoints.

ListenerHttp1Settings

Provides settings related to HTTP/1.x protocol.

ListenerSecureSocket

Configures the SSL/TLS options to be used for HTTP service.

LoadBalanceActionErrorData

Represents the details of the LoadBalanceActionError.

LoadBalanceClientConfiguration

The configurations related to the load balancing client endpoint.

Local

Presents a read-only view of the local address.

MethodNotAllowed

The status code response record of MethodNotAllowed.

MovedPermanently

The status code response record of MovedPermanently.

MultipleChoices

The status code response record of MultipleChoices.

MutualSslHandshake

A record for providing mutual SSL handshake results.

NoContent

The status code response record of NoContent.

NonAuthoritativeInformation

The status code response record of NonAuthoritativeInformation.

NotAcceptable

The status code response record of NotAcceptable.

NotFound

The status code response record of NotFound.

NotImplemented

The status code response record of NotImplemented.

NotModified

The status code response record of NotModified.

OAuth2ClientCredentialsGrantConfig

Represents OAuth2 client credentials grant configurations for OAuth2 authentication.

OAuth2IntrospectionConfig

Represents OAuth2 introspection server configurations for OAuth2 authentication.

OAuth2IntrospectionConfigWithScopes

Represents the auth annotation for OAuth2 introspection server configurations with scopes.

OAuth2PasswordGrantConfig

Represents OAuth2 password grant configurations for OAuth2 authentication.

OAuth2RefreshTokenGrantConfig

Represents OAuth2 refresh token grant configurations for OAuth2 authentication.

Ok

The status code response record of Ok.

PartialContent

The status code response record of PartialContent.

PayloadTooLarge

The status code response record of PayloadTooLarge.

PaymentRequired

The status code response record of PaymentRequired.

PermanentRedirect

The status code response record of PermanentRedirect.

PoolConfiguration

Configurations for managing HTTP client connection pool.

PreconditionFailed

The status code response record of PreconditionFailed.

ProxyAuthenticationRequired

The status code response record of ProxyAuthenticationRequired.

ProxyConfig

Proxy server configurations to be used with the HTTP client endpoint.

RangeNotSatisfiable

The status code response record of RangeNotSatisfiable.

Remote

Presents a read-only view of the remote address.

RequestHeaderFieldsTooLarge

The status code response record of RequestHeaderFieldsTooLarge.

RequestLimitConfigs

Provides inbound request URI, total header and entity body size threshold configurations.

RequestTimeout

The status code response record of RequestTimeout.

ResetContent

The status code response record of ResetContent.

ResponseLimitConfigs

Provides inbound response status line, total header and entity body size threshold configurations.

RetryConfig

Provides configurations for controlling the retrying behavior in failure scenarios.

RollingWindow

Represents a rolling window in the Circuit Breaker.

SeeOther

The status code response record of SeeOther.

ServiceUnavailable

The status code response record of ServiceUnavailable.

SwitchingProtocols

The status code response record of SwitchingProtocols.

TargetService

Represents a single service and its related configurations.

TemporaryRedirect

The status code response record of TemporaryRedirect.

Unauthorized

The status code response record of Unauthorized.

UnsupportedMediaType

The status code response record of UnsupportedMediaType.

UpgradeRequired

The status code response record of UpgradeRequired.

UriTooLong

The status code response record of UriTooLong.

UseProxy

The status code response record of UseProxy.

Constants

[123]

AGE

HTTP header key age.

AUTH_HEADER

Represents the Authorization header name.

AUTH_SCHEME_BASIC

The prefix used to denote the Basic authentication scheme.

AUTH_SCHEME_BEARER

The prefix used to denote the Bearer authentication scheme.

AUTHORIZATION

HTTP header key authorization

CACHE_CONTROL

HTTP header key cache-control.

CACHE_CONTROL_AND_VALIDATORS

This is a more restricted mode of RFC 7234.

CB_CLOSED_STATE

Represents the closed state of the circuit.

CB_HALF_OPEN_STATE

Represents the half-open state of the circuit.

CB_OPEN_STATE

Represents the open state of the circuit.

CHUNKING_ALWAYS

Always set chunking header in the response.

CHUNKING_AUTO

If the payload is less than 8KB, content-length header is set in the outbound request/response, otherwise chunking header is set in the outbound request/response.}

CHUNKING_NEVER

Never set the chunking header even if the payload is larger than 8KB in the outbound request/response.

COMPRESSION_ALWAYS

Always set accept-encoding/content-encoding in outbound request/response.

COMPRESSION_AUTO

When service behaves as a HTTP gateway inbound request/response accept-encoding option is set as the outbound request/response accept-encoding/content-encoding option.

COMPRESSION_NEVER

Never set accept-encoding/content-encoding header in outbound request/response.

CONNECTION

HTTP header key connection.

CONTENT_LENGTH

HTTP header key content-length.

CONTENT_TYPE

HTTP header key content-type.

DATE

HTTP header key date.

ETAG

HTTP header key etag.

EXPECT

HTTP header key expect.

EXPIRES

HTTP header key expires.

FAILED

Mutual SSL handshake has failed.

HTTP_DELETE

Constant for the HTTP DELETE method

HTTP_FORWARD

Constant for the HTTP FORWARD method

HTTP_GET

Constant for the HTTP GET method

HTTP_HEAD

Constant for the HTTP HEAD method

HTTP_NONE

Constant for the identify not an HTTP Operation

HTTP_OPTIONS

Constant for the HTTP OPTIONS method

HTTP_PATCH

Constant for the HTTP PATCH method

HTTP_POST

Constant for the HTTP POST method

HTTP_PUT

Constant for the HTTP PUT method

HTTP_SUBMIT

constant for the HTTP SUBMIT method

IF_MATCH

HTTP header key if-match

IF_MODIFIED_SINCE

HTTP header key if-modified-since.

IF_NONE_MATCH

HTTP header key if-none-match.

IF_RANGE

HTTP header key if-range

IF_UNMODIFIED_SINCE

HTTP header key if-unmodified-since

KEEPALIVE_ALWAYS

Keeps the connection alive irrespective of the connection header value }

KEEPALIVE_AUTO

Decides to keep the connection alive or not based on the connection header of the client request }

KEEPALIVE_NEVER

Closes the connection irrespective of the connection header value }

LAST_MODIFIED

HTTP header key last-modified.

LEADING

Header is placed before the payload of the request/response.

LOCATION

HTTP header key location.

MAX_AGE

When used in requests, max-age implies that clients are not willing to accept responses whose age is greater than max-age.

MAX_STALE

Indicates that the client is willing to accept responses which have exceeded their freshness lifetime by no more than the specified number of seconds.

MAX_STALE_ANY_AGE

Setting this as the max-stale directives indicates that the max-stale directive does not specify a limit.

MIN_FRESH

Indicates that the client is only accepting responses whose freshness lifetime >= current age + min-fresh.

MULTIPART_AS_PRIMARY_TYPE

Represents multipart primary type

MUST_REVALIDATE

Indicates that once the response has become stale, it should not be reused for subsequent requests without validating with the origin server.

NO_CACHE

Forces the cache to validate a cached response with the origin server before serving.

NO_STORE

Instructs the cache to not store a response in non-volatile storage.

NO_TRANSFORM

Instructs intermediaries not to transform the payload.

NONE

Not a mutual ssl connection.

ONLY_IF_CACHED

Indicates that the client is only willing to accept a cached response.

PASSED

Mutual SSL handshake is successful.

PRAGMA

HTTP header key pragma.

PRIVATE

Indicates that the response is intended for a single user and should not be stored by shared caches.

PROXY_AUTHORIZATION

HTTP header key proxy-authorization.

PROXY_REVALIDATE

Has the same semantics as must-revalidate, except that this does not apply to private caches.

PUBLIC

Indicates that any cache may store the response.

REDIRECT_FOUND_302

Represents the HTTP redirect status code 302 - Found.

REDIRECT_MOVED_PERMANENTLY_301

Represents the HTTP redirect status code 301 - Moved Permanently.

REDIRECT_MULTIPLE_CHOICES_300

Represents the HTTP redirect status code 300 - Multiple Choices.

REDIRECT_NOT_MODIFIED_304

Represents the HTTP redirect status code 304 - Not Modified.

REDIRECT_PERMANENT_REDIRECT_308

Represents the HTTP redirect status code 308 - Permanent Redirect.

REDIRECT_SEE_OTHER_303

Represents the HTTP redirect status code 303 - See Other.

REDIRECT_TEMPORARY_REDIRECT_307

Represents the HTTP redirect status code 307 - Temporary Redirect.

REDIRECT_USE_PROXY_305

Represents the HTTP redirect status code 305 - Use Proxy.

REQUEST_METHOD

Constant for the request method reference.

RESOURCE_NAME

Constant for the resource name reference.

RFC_7234

Caching behaviour is as specified by the RFC 7234 specification.

S_MAX_AGE

In shared caches, s-maxage overrides the max-age or expires header field.

SERVER

HTTP header key server.

SERVICE_NAME

Constant for the service name reference.

STATUS_ACCEPTED

The HTTP response status code: 202 Accepted

STATUS_BAD_GATEWAY

The HTTP response status code: 502 Bad Gateway

STATUS_BAD_REQUEST

The HTTP response status code: 400 Bad Request

STATUS_CONFLICT

The HTTP response status code: 409 Conflict

STATUS_CONTINUE

The HTTP response status code: 100 Continue

STATUS_CREATED

The HTTP response status code: 201 Created

STATUS_EXPECTATION_FAILED

The HTTP response status code: 417 Expectation Failed

STATUS_FORBIDDEN

The HTTP response status code: 403 Forbidden

STATUS_FOUND

The HTTP response status code: 302 Found

STATUS_GATEWAY_TIMEOUT

The HTTP response status code: 504 Gateway Timeout

STATUS_GONE

The HTTP response status code: 410 Gone

STATUS_HTTP_VERSION_NOT_SUPPORTED

The HTTP response status code: 505 HTTP Version Not Supported

STATUS_INTERNAL_SERVER_ERROR

The HTTP response status code: 500 Internal Server Error

STATUS_LENGTH_REQUIRED

The HTTP response status code: 411 Length Required

STATUS_METHOD_NOT_ALLOWED

The HTTP response status code: 405 Method Not Allowed

STATUS_MOVED_PERMANENTLY

The HTTP response status code: 301 Moved Permanently

STATUS_MULTIPLE_CHOICES

The HTTP response status code: 300 Multiple Choices

STATUS_NO_CONTENT

The HTTP response status code: 204 No Content

STATUS_NON_AUTHORITATIVE_INFORMATION

The HTTP response status code: 203 Non Authoritative Information

STATUS_NOT_ACCEPTABLE

The HTTP response status code: 406 Not Acceptable

STATUS_NOT_FOUND

The HTTP response status code: 404 Not Found

STATUS_NOT_IMPLEMENTED

The HTTP response status code: 501 Not Implemented

STATUS_NOT_MODIFIED

The HTTP response status code: 304 Not Modified

STATUS_OK

The HTTP response status code: 200 OK

STATUS_PARTIAL_CONTENT

The HTTP response status code: 206 Partial Content

STATUS_PAYLOAD_TOO_LARGE

The HTTP response status code: 413 Payload Too Large

STATUS_PAYMENT_REQUIRED

The HTTP response status code: 402 Payment Required

STATUS_PERMANENT_REDIRECT

The HTTP response status code: 308 Permanent Redirect

STATUS_PRECONDITION_FAILED

The HTTP response status code: 412 Precondition Failed

STATUS_PROXY_AUTHENTICATION_REQUIRED

The HTTP response status code: 407 Proxy Authentication Required

STATUS_RANGE_NOT_SATISFIABLE

The HTTP response status code: 416 Range Not Satisfiable

STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE

The HTTP response status code: 431 Request Header Fields Too Large

STATUS_REQUEST_TIMEOUT

The HTTP response status code: 408 Request Timeout

STATUS_RESET_CONTENT

The HTTP response status code: 205 Reset Content

STATUS_SEE_OTHER

The HTTP response status code: 303 See Other

STATUS_SERVICE_UNAVAILABLE

The HTTP response status code: 503 Service Unavailable

STATUS_SWITCHING_PROTOCOLS

The HTTP response status code: 101 Switching Protocols

STATUS_TEMPORARY_REDIRECT

The HTTP response status code: 307 Temporary Redirect

STATUS_UNAUTHORIZED

The HTTP response status code: 401 Unauthorized

STATUS_UNSUPPORTED_MEDIA_TYPE

The HTTP response status code: 415 Unsupported Media Type

STATUS_UPGRADE_REQUIRED

The HTTP response status code: 426 Upgrade Required

STATUS_URI_TOO_LONG

The HTTP response status code: 414 URI Too Long

STATUS_USE_PROXY

The HTTP response status code: 305 Use Proxy

TRAILING

Header is placed after the payload of the request/response.

TRANSFER_ENCODING

HTTP header key transfer-encoding.

UPGRADE

HTTP header key upgrade.

WARNING

HTTP header key warning.

Enums

[3]

CertValidationType

Represents certification validation type options.

Protocol

Represents protocol options.

VerifyClient

Represents client verify options.

Annotations

[5]

CallerInfo

The annotation which is used to configure the type of the response.

The annotation which is used to define the Header resource signature parameter.

Payload

The annotation which is used to define the Payload resource signature parameter and return parameter.

ResourceConfig

The annotation which is used to configure an HTTP resource.

ServiceConfig

The annotation which is used to configure an HTTP service.

Types

[19]

CachingPolicy

Used for configuring the caching behaviour.

Chunking

Defines the possible values for the chunking configuration in HTTP services and clients.

CircuitState

A finite type for modeling the states of the Circuit Breaker.

ClientAuthConfig

Defines the authentication configurations for the HTTP client.

Compression

Options to compress using gzip or deflate.

HeaderPosition

Defines the position of the headers in the request/response.

HttpOperation

Defines the HTTP operations related to circuit breaker, failover and load balancer.

HttpVersion

Defines the supported HTTP protocols.

KeepAlive

Defines the possible values for the keep-alive configuration in service and client endpoints.

ListenerAuthConfig

Defines the authentication configurations for the HTTP listener.

LoadBalanceActionError

Represents an error occurred in an remote function of the Load Balance connector.

MutualSslStatus

Defines the possible values for the mutual ssl status.

OAuth2GrantConfig

Represents OAuth2 grant configurations for OAuth2 authentication.

PayloadType

The types of the response payload that are returned by the HTTP client after the data binding operation

RedirectCode

Defines the HTTP redirect codes as a type.

RequestMessage

The types of messages that are accepted by HTTP client when sending out the outbound request.

ResponseMessage

The types of messages that are accepted by HTTP listener when sending out the outbound response.

StatusCodeResponse

Defines the possible status code response record types.

TargetType

The types of data values that are expected by the HTTP client to return after the data binding operation

Errors

[42]

AllLoadBalanceEndpointsFailedError

Represents a client error that occurred due to all the load balance endpoint failure

AllRetryAttemptsFailed

Represents a client error that occurred due to all the the retry attempts failure

CircuitBreakerConfigError

Represents a client error that occurred due to circuit breaker configuration error.

ClientAuthError

Defines the Auth error types that returned from client

ClientError

Defines the possible client error types

CookieHandlingError

Represents a cookie error that occurred when using the cookies

Error

Defines the common error type for the module

FailoverActionFailedError

Represents a client error that occurred due to failover action failure

FailoverAllEndpointsFailedError

Represents a client error that occurred due to all the failover endpoint failure

GenericClientError

Represents a generic client error

GenericListenerError

Represents a generic listener error

HeaderNotFoundError

Represents a header not found error when retrieving headers

Http2ClientError

Represents an HTTP/2 client generic error

IdleTimeoutError

Represents the error that triggered upon a request/response idle timeout

InboundRequestError

Defines the listener error types that returned while receiving inbound request

InboundResponseError

Defines the client error types that returned while receiving inbound response

InitializingInboundRequestError

Represents a listener error that occurred due to inbound request initialization failure

InitializingInboundResponseError

Represents a client error that occurred due to inbound response initialization failure

InitializingOutboundRequestError

Represents a client error that occurred due to outbound request initialization failure

InitializingOutboundResponseError

Represents a listener error that occurred due to outbound response initialization failure

Initiating100ContinueResponseError

Represents an error that occurred due to 100 continue response initialization failure

InvalidCookieError

Represents a cookie error that occurred when sending cookies in the response

ListenerAuthError

Defines the Auth error types that returned from listener

ListenerError

Defines the possible listener error types

MaximumWaitTimeExceededError

Represents a client error that occurred exceeding maximum wait time

NoContentError

Represents an error, which occurred due to the absence of the payload

OutboundRequestError

Defines the client error types that returned while sending outbound request

OutboundResponseError

Defines the listener error types that returned while sending outbound response

PayloadBindindError

Represents an error, which occurred due to a payload binging

ReadingInboundRequestBodyError

Represents a listener error that occurred while writing the inbound request entity body

ReadingInboundRequestHeadersError

Represents a listener error that occurred while reading inbound request headers

ReadingInboundResponseBodyError

Represents a client error that occurred while reading inbound response entity body

ReadingInboundResponseHeadersError

Represents a client error that occurred while reading inbound response headers

ResiliencyError

Defines the resiliency error types that returned from client

SslError

Represents a client error that occurred due to SSL failure

UnsupportedActionError

Represents a client error that occurred due to unsupported action invocation

UpstreamServiceUnavailableError

Represents a client error that occurred due to upstream service unavailability

Writing100ContinueResponseError

Represents an error that occurred while writing 100 continue response

WritingOutboundRequestBodyError

Represents a client error that occurred while writing outbound request entity body

WritingOutboundRequestHeadersError

Represents a client error that occurred while writing outbound request headers

WritingOutboundResponseBodyError

Represents a listener error that occurred while writing outbound response entity body

WritingOutboundResponseHeadersError

Represents a listener error that occurred while writing outbound response headers