ballerina.net.http package

public struct Connection

Represents the HTTP server connector connection

Field Name Data Type Description Default Value
remoteHost string The server host name
port int The server port
  • < Connection > createSessionIfAbsent ( ) ( Session )

    Gets the Session struct for a valid session cookie from the connection. Otherwise creates a new Session struct.

    Return Variable Data Type Description
    Session HTTP Session struct
  • < Connection > forward ( InResponse res ) ( HttpConnectorError )

    Forwards inbound response to the caller

    Parameter Name Data Type Description
    res InResponse The inbound response message

    Return Variable Data Type Description
    HttpConnectorError Error occured during HTTP server connector forward
  • < Connection > getSession ( ) ( Session )

    Gets the Session struct from the connection if it is present

    Return Variable Data Type Description
    Session The HTTP Session struct assoicated with the request
  • < Connection > redirect ( OutResponse response , RedirectCode code , string[] locations ) ( HttpConnectorError )

    Sends a redirect response to the user with given redirection status code.

    Parameter Name Data Type Description
    response OutResponse Response to be sent to client.
    code RedirectCode
    locations string[] Array of locations where the redirection can happen.

    Return Variable Data Type Description
    HttpConnectorError Returns an HttpConnectorError if there was any issue in sending the response.
  • < Connection > respond ( OutResponse res ) ( HttpConnectorError )

    Sends outbound response to the caller

    Parameter Name Data Type Description
    res OutResponse The outbound response message

    Return Variable Data Type Description
    HttpConnectorError Error occured during HTTP server connector respond
  • < Connection > respondContinue ( ) ( HttpConnectorError )

    Sends a 100-continue response to the client.

    Return Variable Data Type Description
    HttpConnectorError Returns an HttpConnectorError if there was any issue in sending the response.

public struct ConnectionThrottling

This struct represents the options to be used for connection throttling

Field Name Data Type Description Default Value
maxActiveConnections int Number of maximum active connections for connection throttling. Default value -1, indicates the number of connections are not restricted -1
waitTime int Maximum waiting time for a request to grab an idle connection from the client connector 60000

public struct FollowRedirects

FollowRedirects struct represents HTTP redirect related options to be used for HTTP client invocation

Field Name Data Type Description Default Value
enabled boolean Enable redirect false
maxCount int Maximun number of redirects to follow 5

public struct HttpConnectorError

HttpConnectorError struct represents an error occured during the HTTP client invocation

Field Name Data Type Description Default Value
message string An error message explaining about the error
cause error The error that caused HttpConnectorError to get thrown
statusCode int HTTP status code

public struct InRequest

Represents an HTTP inbound request message

Field Name Data Type Description Default Value
rawPath string path: Resource path of request URI
method string HTTP request method
httpVersion string The version of HTTP
userAgent string User-Agent request header
extraPathInfo string path: Resource path of request URI
  • < InRequest > expects100Continue ( ) ( boolean )

    Checks whether the client expects a 100-continue response.

    Return Variable Data Type Description
    boolean Returns true if the client expects a 100-continue response. If not, returns false.
  • < InRequest > getEntity ( ) ( Entity )

    Get the entity from the inbound request with the body included

    Return Variable Data Type Description
    Entity Entity of the request
  • < InRequest > getHeader ( string headerName ) ( string )

    Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string The first header value for the provided header name. Returns null if the header does not exist.
  • < InRequest > getHeaders ( string headerName ) ( string[] )

    Gets transport headers from the inbound request

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string[] The header values struct array for a given header name
  • < InRequest > getMatrixParams ( string path ) ( map )

    Get matrix parameters from the request

    Parameter Name Data Type Description
    path string Path to the location of matrix parameters

    Return Variable Data Type Description
    map A map of matrix paramters which can be found for a given path
  • < InRequest > getProperty ( string propertyName ) ( string )

    Retrieves the named property from the request

    Parameter Name Data Type Description
    propertyName string The name of the property

    Return Variable Data Type Description
    string The property value
  • < InRequest > getQueryParams ( ) ( map )

    Gets the query parameters from the HTTP request as a map

    Return Variable Data Type Description
    map The map of query params
  • < InRequest > setEntity ( Entity entity )

    Set the entity to inbound request

    Parameter Name Data Type Description
    entity Entity
  • < InRequest > getBinaryPayload ( ) ( blob )

    Gets the inbound request payload in blob format

    Return Variable Data Type Description
    blob The blob representation of the message payload
  • < InRequest > getByteChannel ( ) ( ByteChannel )

    Get the inbound request payload as a byte channel except for multiparts. In case of multiparts, please use 'getMultiparts()' instead.

    Return Variable Data Type Description
    ByteChannel A byte channel as the message payload
  • < InRequest > getContentLength ( ) ( int )

    Gets the Content-Length header from the inbound request

    Return Variable Data Type Description
    int length of the message
  • < InRequest > getFormParams ( ) ( map )

    Gets the form parameters from the HTTP request as a map

    Return Variable Data Type Description
    map The map of form params
  • < InRequest > getJsonPayload ( ) ( json )

    Gets the inbound request payload in JSON format

    Return Variable Data Type Description
    json The JSON reresentation of the message payload
  • < InRequest > getMultiparts ( ) ( Entity[] )

    Get multiparts from inbound request

    Return Variable Data Type Description
    Entity[] Returns the body parts as an array of entities
  • < InRequest > getStringPayload ( ) ( string )

    Gets the inbound request payload as a string

    Return Variable Data Type Description
    string The string representation of the message payload
  • < InRequest > getXmlPayload ( ) ( xml )

    Gets the inbound request payload in XML format

    Return Variable Data Type Description
    xml The XML representation of the message payload

public struct InResponse

Represents an HTTP Inbound response message

Field Name Data Type Description Default Value
statusCode int The response status code
reasonPhrase string The status code reason phrase
server string The server header
  • < InResponse > getEntity ( ) ( Entity )

    Get the entity from the inbound response with the body

    Return Variable Data Type Description
    Entity Entity of the response
  • < InResponse > getHeader ( string headerName ) ( string )

    Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string The first header value struct for the provided header name. Returns null if the header does not exist.
  • < InResponse > getHeaders ( string headerName ) ( string[] )

    Gets the HTTP headers from the inbound response

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string[] The header values struct array for a given header name
  • < InResponse > getProperty ( string propertyName ) ( string )

    Retrieve a response property

    Parameter Name Data Type Description
    propertyName string The name of the property

    Return Variable Data Type Description
    string The property value
  • < InResponse > getBinaryPayload ( ) ( blob )

    Gets the inbound response payload in blob format

    Return Variable Data Type Description
    blob The blob representation of the message payload
  • < InResponse > getByteChannel ( ) ( ByteChannel )

    Gets the inbound response payload as a byte channel except for multiparts. In case of multiparts, please use 'getMultiparts()' instead.

    Return Variable Data Type Description
    ByteChannel A byte channel as the message payload
  • < InResponse > getContentLength ( ) ( int )

    Gets the Content-Length header value from the inbound response

    Return Variable Data Type Description
    int length of the message
  • < InResponse > getJsonPayload ( ) ( json )

    Gets the inbound response payload in JSON format

    Return Variable Data Type Description
    json The JSON reresentation of the message payload
  • < InResponse > getMultiparts ( ) ( Entity[] )

    Get multiparts from inbound response

    Return Variable Data Type Description
    Entity[] Returns the body parts as an array of entities
  • < InResponse > getStringPayload ( ) ( string )

    Gets the inbound response payload as a string

    Return Variable Data Type Description
    string The string representation of the message payload
  • < InResponse > getXmlPayload ( ) ( xml )

    Gets the inbound response payload in XML format

    Return Variable Data Type Description
    xml The XML representation of the message payload
  • < InResponse > setEntity ( Entity entity )

    Set the entity to inbound response

    Parameter Name Data Type Description
    entity Entity

public struct Options

Options struct represents options to be used for HTTP client invocation

Field Name Data Type Description Default Value
port int Port number of the remote service
endpointTimeout int Endpoint timeout value in millisecond 60000
keepAlive boolean Keep the connection or close it true
transferEncoding string The types of encoding applied to the request chunking
chunking string The chunking behaviour of the request auto
httpVersion string The version of HTTP outbound request
forwarded string The choice of setting forwarded/x-forwarded header disable
followRedirects FollowRedirects Redirect related options
ssl SSL SSL/TLS related options
retryConfig Retry Retry related options
proxy Proxy Proxy server related options
connectionThrottling ConnectionThrottling port: Port number of the remote service

public struct OutRequest

Represents an HTTP outbound request message

  • < OutRequest > addHeader ( string headerName , string headerValue )

    Adds the specified key/value pair as an HTTP header to the outbound request

    Parameter Name Data Type Description
    headerName string The header name
    headerValue string The header value
  • < OutRequest > getEntity ( ) ( Entity )

    Get the entity from the outbound request

    Return Variable Data Type Description
    Entity Entity of the request
  • < OutRequest > getHeader ( string headerName ) ( string )

    Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string The first header value for the provided header name. Returns null if the header does not exist.
  • < OutRequest > getHeaders ( string headerName ) ( string[] )

    Gets transport headers from the outbound request

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string[] The header values struct array for a given header name
  • < OutRequest > getProperty ( string propertyName ) ( string )

    Retrieves the named property from the request

    Parameter Name Data Type Description
    propertyName string The name of the property

    Return Variable Data Type Description
    string The property value
  • < OutRequest > removeAllHeaders ( )

    Removes all transport headers from the message

  • < OutRequest > removeHeader ( string key )

    Removes a transport header from the outbound request

    Parameter Name Data Type Description
    key string The header name
  • < OutRequest > setEntity ( Entity entity )

    Set the entity to outbound request

    Parameter Name Data Type Description
    entity Entity
  • < OutRequest > setHeader ( string headerName , string headerValue )

    Sets the value of a transport header

    Parameter Name Data Type Description
    headerName string The header name
    headerValue string The header value
  • < OutRequest > setProperty ( string propertyName , string propertyValue )

    Sets a request property

    Parameter Name Data Type Description
    propertyName string The name of the property
    propertyValue string The value of the property
  • < OutRequest > getBinaryPayload ( ) ( blob )

    Gets the outbound request payload in blob format

    Return Variable Data Type Description
    blob The blob representation of the message payload
  • < OutRequest > getByteChannel ( ) ( ByteChannel )

    Get the outbound request payload as a byte channel except for multiparts. In case of multiparts, please use 'getMultiparts()' instead.

    Return Variable Data Type Description
    ByteChannel A byte channel as the message payload
  • < OutRequest > getContentLength ( ) ( int )

    Gets the Content-Length header from the Outbound request

    Return Variable Data Type Description
    int length of the message
  • < OutRequest > getJsonPayload ( ) ( json )

    Gets the outbound request payload in JSON format

    Return Variable Data Type Description
    json The JSON reresentation of the message payload
  • < OutRequest > getMultiparts ( ) ( Entity[] )

    Get multiparts from outbound request

    Return Variable Data Type Description
    Entity[] Returns the body parts as an array of entities
  • < OutRequest > getStringPayload ( ) ( string )

    Gets the outbound request payload as a string

    Return Variable Data Type Description
    string The string representation of the message payload
  • < OutRequest > getXmlPayload ( ) ( xml )

    Gets the outbound request payload in XML format

    Return Variable Data Type Description
    xml The XML representation of the message payload
  • < OutRequest > setBinaryPayload ( blob payload )

    Sets a blob as the outbound request payload

    Parameter Name Data Type Description
    payload blob The blob representation of the message payload
  • < OutRequest > setByteChannel ( ByteChannel payload )

    Set a byte channel as the outbound request payload

    Parameter Name Data Type Description
    payload ByteChannel The byte channel representation of the message payload
  • < OutRequest > setFileAsPayload ( File fileHandler , string contentType )

    Sets the entity body of the outbound request with the given file content

    Parameter Name Data Type Description
    fileHandler File File that needs to be set to the payload
    contentType string Content-Type of the given file
  • < OutRequest > setJsonPayload ( json payload )

    Sets a JSON as the outbound request payload

    Parameter Name Data Type Description
    payload json The JSON payload to be set to the request
  • < OutRequest > setMultiparts ( Entity[] bodyParts , string contentType )

    Set multiparts as the request payload

    Parameter Name Data Type Description
    bodyParts Entity[] Represent body parts that needs to be set to the request
    contentType string Content type of the top level message
  • < OutRequest > setStringPayload ( string payload )

    Sets a string as the outbound request payload

    Parameter Name Data Type Description
    payload string The payload to be set to the request as a string
  • < OutRequest > setXmlPayload ( xml payload )

    Sets an XML as the payload

    Parameter Name Data Type Description
    payload xml The XML payload object

public struct OutResponse

Represents an HTTP outbound response message

Field Name Data Type Description Default Value
statusCode int The response status code
reasonPhrase string The status code reason phrase
  • < OutResponse > addHeader ( string headerName , string headerValue )

    Adds the specified key/value pair as an HTTP header to the outbound response

    Parameter Name Data Type Description
    headerName string The header name
    headerValue string The header value
  • < OutResponse > getEntity ( ) ( Entity )

    Get the entity from the outbound response

    Return Variable Data Type Description
    Entity Entity of the response
  • < OutResponse > getHeader ( string headerName ) ( string )

    Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string The first header value struct for the provided header name. Returns null if the header does not exist.
  • < OutResponse > getHeaders ( string headerName ) ( string[] )

    Gets the HTTP headers from the outbound response

    Parameter Name Data Type Description
    headerName string The header name

    Return Variable Data Type Description
    string[] The header values struct array for a given header name
  • < OutResponse > getProperty ( string propertyName ) ( string )

    Retrieve a response property

    Parameter Name Data Type Description
    propertyName string The name of the property

    Return Variable Data Type Description
    string The property value
  • < OutResponse > getBinaryPayload ( ) ( blob )

    Gets the outbound response payload in blob format

    Return Variable Data Type Description
    blob The blob representation of the message payload
  • < OutResponse > getByteChannel ( ) ( ByteChannel )

    Gets the outbound response payload as a byte channel except for multiparts. In case of multiparts, please use 'getMultiparts()' instead.

    Return Variable Data Type Description
    ByteChannel A byte channel as the message payload
  • < OutResponse > getContentLength ( ) ( int )

    Gets the Content-Length header value from the outbound response

    Return Variable Data Type Description
    int length of the message
  • < OutResponse > getJsonPayload ( ) ( json )

    Gets the outbound response payload in JSON format

    Return Variable Data Type Description
    json The JSON reresentation of the message payload
  • < OutResponse > getMultiparts ( ) ( Entity[] )

    Get multiparts from outbound response

    Return Variable Data Type Description
    Entity[] Returns the body parts as an array of entities
  • < OutResponse > getStringPayload ( ) ( string )

    Gets the outbound response payload as a string

    Return Variable Data Type Description
    string The string representation of the message payload
  • < OutResponse > getXmlPayload ( ) ( xml )

    Gets the outbound response payload in XML format

    Return Variable Data Type Description
    xml The XML representation of the message payload
  • < OutResponse > setBinaryPayload ( blob payload )

    Sets a blob as the outbound response payload

    Parameter Name Data Type Description
    payload blob The blob representation of the message payload
  • < OutResponse > setByteChannel ( ByteChannel payload )

    Sets a byte channel as the outbound response payload

    Parameter Name Data Type Description
    payload ByteChannel The byte channel representation of the message payload
  • < OutResponse > setFileAsPayload ( File fileHandler , string contentType )

    Sets the entity body of the outbound response with the given file content

    Parameter Name Data Type Description
    fileHandler File File that needs to be set to the payload
    contentType string Content-Type of the file
  • < OutResponse > setJsonPayload ( json payload )

    Sets a JSON as the outbound response payload

    Parameter Name Data Type Description
    payload json The JSON payload object
  • < OutResponse > setMultiparts ( Entity[] bodyParts , string contentType )

    Set multiparts as the response payload

    Parameter Name Data Type Description
    bodyParts Entity[] Represent body parts that needs to be set to the response
    contentType string Content type of the top level message
  • < OutResponse > setStringPayload ( string payload )

    Sets a string as the outbound response payload

    Parameter Name Data Type Description
    payload string The payload to be set to the response as a string
  • < OutResponse > setXmlPayload ( xml payload )

    Sets an XML as the outbound response payload

    Parameter Name Data Type Description
    payload xml The XML payload object
  • < OutResponse > removeAllHeaders ( )

    Removes all transport headers from the response

  • < OutResponse > removeHeader ( string key )

    Removes a transport header from the response

    Parameter Name Data Type Description
    key string The header name
  • < OutResponse > setEntity ( Entity entity )

    Set the entity to outbound response

    Parameter Name Data Type Description
    entity Entity
  • < OutResponse > setHeader ( string headerName , string headerValue )

    Sets the value of a transport header

    Parameter Name Data Type Description
    headerName string The header name
    headerValue string The header value
  • < OutResponse > setProperty ( string propertyName , string propertyValue )

    Sets a response property

    Parameter Name Data Type Description
    propertyName string The name of the property
    propertyValue string The value of the property

public struct Proxy

Proxy struct represents proxy server configurations to be used for HTTP client invocation

Field Name Data Type Description Default Value
host string proxyHost: host name of the proxy server
port int proxyHost: host name of the proxy server
userName string proxyHost: host name of the proxy server
password string proxyHost: host name of the proxy server

public struct Retry

Retry struct represents retry related options for HTTP client invocation

Field Name Data Type Description Default Value
count int Number of retries
interval int Retry interval in millisecond

public struct SSL

SSL struct represents SSL/TLS options to be used for HTTP client invocation

Field Name Data Type Description Default Value
trustStoreFile string File path to trust store file
trustStorePassword string Trust store password
keyStoreFile string File path to key store file
keyStorePassword string Key store password
sslEnabledProtocols string SSL/TLS protocols to be enabled. eg: TLSv1,TLSv1.1,TLSv1.2
ciphers string List of ciphers to be used. eg: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
sslProtocol string SSL Protocol to be used. eg: TLS1.2
validateCertEnabled boolean The status of validateCertEnabled
cacheSize int Maximum size of the cache
cacheValidityPeriod int Time duration of cache validity period
hostNameVerificationEnabled boolean Enable/disable host name verification

public struct Session

Represents an HTTP Session

  • < Session > getAttribute ( string attributeKey ) ( any )

    Gets the named session attribute

    Parameter Name Data Type Description
    attributeKey string HTTP session attribute key

    Return Variable Data Type Description
    any HTTP session attribute value
  • < Session > getAttributeNames ( ) ( string[] )

    Gets the session attribute names

    Return Variable Data Type Description
    string[] Session attribute names array
  • < Session > getAttributes ( ) ( map )

    Gets the session attribute key value pairs as a map

    Return Variable Data Type Description
    map The map of session attributes key value pairs
  • < Session > getCreationTime ( ) ( int )

    Gets the session creation time

    Return Variable Data Type Description
    int Session creation time
  • < Session > getId ( ) ( string )

    Gets the session cookie ID

    Return Variable Data Type Description
    string Session ID
  • < Session > getLastAccessedTime ( ) ( int )

    Gets the last time the sessions was accessed

    Return Variable Data Type Description
    int Last accessed time of the session
  • < Session > getMaxInactiveInterval ( ) ( int )

    Gets maximum inactive interval for the session. The session expires after this time period.

    Return Variable Data Type Description
    int Session max inactive interval
  • < Session > invalidate ( )

    Invalidates the session and it will no longer be accessible from the request

  • < Session > isNew ( ) ( boolean )

    Checks whether the given session is a newly created session or an existing session

    Return Variable Data Type Description
    boolean Indicates if the session is a newly created session or not
  • < Session > removeAttribute ( string attributeKey )

    Remove the named session attribute

    Parameter Name Data Type Description
    attributeKey string Session attribute key
  • < Session > setAttribute ( string attributeKey , any attributeValue )

    Sets the specified key/value pair as a session attribute

    Parameter Name Data Type Description
    attributeKey string Session attribute key
    attributeValue any Session attribute Value
  • < Session > setMaxInactiveInterval ( int timeInterval )

    Sets the maximum inactive interval for the session. The session expires after this time period.

    Parameter Name Data Type Description
    timeInterval int Session max inactive interval

public function parseHeader ( string headerValue ) ( string , map , error )

Parse headerValue and return value with parameter map

Parameter Name Data Type Description
headerValue string The header value

Return Variable Data Type Description
string The header value
map The header value parameter map
error Error occured during header parsing

public connector HttpClient ( string serviceUri , Options connectorOptions )

HTTP client connector for outbound HTTP requests

Parameter Name Data Type Description
serviceUri string URI of the service
connectorOptions Options connector options

Actions:

  • < HttpClient > delete ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    The DELETE action implementation of the HTTP connector

    Parameter Name Data Type Description
    path string Resource path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > execute ( string httpVerb , string path , OutRequest req ) ( InResponse , HttpConnectorError )

    Invokes an HTTP call with the specified HTTP verb.

    Parameter Name Data Type Description
    httpVerb string HTTP verb value
    path string Resource path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > forward ( string path , InRequest req ) ( InResponse , HttpConnectorError )

    Forward action can be used to invoke an HTTP call with inbound request's HTTP verb

    Parameter Name Data Type Description
    path string Request path
    req InRequest An HTTP inbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > get ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    GET action implementation of the HTTP Connector

    Parameter Name Data Type Description
    path string Request path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > head ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    The HEAD action implementation of the HTTP Connector.

    Parameter Name Data Type Description
    path string Resource path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > options ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    OPTIONS action implementation of the HTTP Connector

    Parameter Name Data Type Description
    path string Request path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > patch ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    The PATCH action implementation of the HTTP Connector.

    Parameter Name Data Type Description
    path string Resource path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > post ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    The POST action implementation of the HTTP Connector.

    Parameter Name Data Type Description
    path string Resource path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation
  • < HttpClient > put ( string path , OutRequest req ) ( InResponse , HttpConnectorError )

    The PUT action implementation of the HTTP Connector.

    Parameter Name Data Type Description
    path string Resource path
    req OutRequest An HTTP outbound request message

    Return Variable Data Type Description
    InResponse The inbound response message
    HttpConnectorError Error occured during HTTP client invocation

public enum RedirectCode

Status codes for HTTP redirect

Name Description
MULTIPLE_CHOICES_300 Represents status code 300 - Multiple Choices.
MOVED_PERMANENTLY_301 Represents status code 301 - Moved Permanently.
FOUND_302 Represents status code 302 - Found.
SEE_OTHER_303 Represents status code 303 - See Other.
NOT_MODIFIED_304 Represents status code 304 - Not Modified.
USE_PROXY_305 Represents status code 305 - Use Proxy.
TEMPORARY_REDIRECT_307 Represents status code 307 - Temporary Redirect.

public annotation configuration

Configuration for HTTP service

Attribute Name Data Type Description
host string Host of the service
port int Port number of the service
httpsPort int HTTPS port number of service
basePath string Service base path
keyStoreFile string File path to keystore file
keyStorePassword string The keystore password
trustStoreFile string File path to truststore file
trustStorePassword string The truststore password
sslVerifyClient string The type of client certificate verification
certPassword string The certificate password
sslEnabledProtocols string SSL/TLS protocols to be enabled
ciphers string List of ciphers to be used
sslProtocol string The SSL protocol version
validateCertEnabled boolean validateCertEnabled
compressionEnabled boolean compressionEnabled
cacheSize int Maximum size of the cache
cacheValidityPeriod int Time duration of cache validity period
allowOrigins string[] The array of origins with which the response is shared by the service
allowCredentials boolean Specifies whether credentials are required to access the service
allowMethods string[] The array of allowed methods by the service
allowHeaders string[] The array of allowed headers by the service
maxAge int The maximum duration to cache the preflight from client side
exposeHeaders string[] The array of allowed headers which are exposed to the client
keepAlive string The keepAlive behaviour of the connection for a particular port
transferEncoding string The types of encoding applied to the response
chunking string The chunking behaviour of the response
maxUriLength int Maximum length allowed for the URL
maxHeaderSize int Maximum size allowed for the headers
maxEntityBodySize int Maximum size allowed for the entity body
webSocket webSocket Annotation to define HTTP to WebSocket upgrade

public annotation resourceConfig

Configuration for HTTP resource

Attribute Name Data Type Description
methods string[] The array of allowed HTTP methods
path string The path of resource
body string Inbound request entity body name which declared in signature
consumes string[] The media types which are accepted by resource
produces string[] The media types which are produced by resource
allowOrigins string[] The array of origins with which the response is shared by the resource
allowCredentials boolean Specifies whether credentials are required to access the resource
allowMethods string[] The array of allowed methods by the resource
allowHeaders string[] The array of allowed headers by the resource
maxAge int The duration to cache the preflight from client side
exposeHeaders string[] The array of allowed headers which are exposed to the client

public annotation webSocket

Annotation to upgrade connection from HTTP to WS in the same base path.

Attribute Name Data Type Description
upgradePath string Upgrade path for the WebSocket service from HTTP to WS.
serviceName string Name of the WebSocket service where the HTTP service should upgrade to.

CONTENT_LENGTH

Attribute Name Data Type Description
CONTENT_LENGTH string Represent 'content-length' header name