Functions of ballerina.net.http package
public function <Request req> addHeader(string headerName, string headerValue)
Adds the specified key/value pair as an HTTP header to the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
headerValue | string | The header value |
public function <Request req> createSessionIfAbsent() (Session)
Gets the Session struct for a valid session cookie from the request. Otherwise creates a new Session struct.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Session | HTTP Session struct |
public function <Request req> expects100Continue() (boolean)
Checks whether the client expects a 100-continue response.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
boolean | Returns true if the client expects a 100-continue response. If not, returns false. |
public function <Request req> getBinaryPayload() (blob)
Gets the request payload in blob format
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
blob | The blob representation of the message payload |
public function <Request req> getContentLength() (int)
Gets the Content-Length header from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | length of the message |
public function <Request req> getFormParams() (map)
Gets the form parameters from the HTTP request as a map
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | The request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
map | The map of form params |
public function <Request req> getHeader(string headerName) (HeaderValue)
Gets a transport header from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HeaderValue | The first header value struct for the provided header name. Returns null if the header does not exist. |
public function <Request req> getHeaders(string headerName) (HeaderValue[])
Gets transport headers from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HeaderValue[] | The header values struct array for a given header name |
public function <Request req> getJsonPayload() (json)
Gets the request payload in JSON format
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
json | The JSON reresentation of the message payload |
public function <Request req> getMethod() (string)
Gets the HTTP method from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | The HTTP request method associated with the request |
public function <Request req> getProperty(string propertyName) (string)
Retrieves the named property from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
propertyName | string | The name of the property |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | The property value |
public function <Request req> getQueryParams() (map)
Gets the query parameters from the HTTP request as a map
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | The request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
map | The map of query params |
public function <Request req> getRequestURL() (string)
Gets the request URL from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | The request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | The request URL value |
public function <Request req> getSession() (Session)
Gets the Session struct from the request if it is present
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Session | The HTTP Session struct assoicated with the request |
public function <Request req> getStringPayload() (string)
Gets the request payload as a string
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | The string representation of the message payload |
public function <Request req> getXmlPayload() (xml)
Gets the request payload in XML format
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | The request message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
xml | The XML representation of the message payload |
public function <Request req> removeAllHeaders()
Removes all transport headers from the message
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
public function <Request req> removeHeader(string key)
Removes a transport header from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
key | string | The header name |
public function <Request req> setBinaryPayload(blob payload)
Sets a blob as the request payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | blob | The blob representation of the message payload |
public function <Request req> setHeader(string headerName, string headerValue)
Sets the value of a transport header
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
headerValue | string | The header value |
public function <Request req> setJsonPayload(json payload)
Sets a JSON as the request payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | json | The JSON payload to be |
public function <Request req> setProperty(string propertyName, string propertyValue)
Sets a request property
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
propertyName | string | The name of the property |
propertyValue | string | The value of the property |
public function <Request req> setStringPayload(string payload)
Sets a string as the request payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | string | The payload to be set to the request as a string |
public function <Request req> setXmlPayload(xml payload)
Sets an XML as the payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
req | Request | A request message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | xml | The XML payload object |
public function <Response res> addHeader(string headerName, string headerValue)
Adds the specified key/value pair as an HTTP header to the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
headerValue | string | The header value |
public function <Response res> forward(Response resp) (HttpConnectorError)
Forwards client service response directly to the caller.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
resp | Response | The new instance of the response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HttpConnectorError | Error occured during HTTP server connector forward |
public function <Response res> getBinaryPayload() (blob)
Gets the response payload in blob format
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
blob | The blob representation of the message payload |
public function <Response res> getContentLength() (int)
Gets the length of the response payload, as given in the Content-Length header of the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | Length of the response payload |
public function <Response res> getHeader(string headerName) (HeaderValue)
Gets the named HTTP header from the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HeaderValue | The first header value struct for the provided header name. Returns null if the header does not exist. |
public function <Response res> getHeaders(string headerName) (HeaderValue[])
Gets the HTTP headers from the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
headerName | string | The header name |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HeaderValue[] | The header values struct array for a given header name |
public function <Response res> getJsonPayload() (json)
Gets the response payload in JSON format
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
json | The JSON reresentation of the message payload |
public function <Response res> getProperty(string propertyName) (string)
Retrieve a response property
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
propertyName | string | The name of the property |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | The property value |
public function <Response res> getStatusCode() (int)
Gets the HTTP status code from the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | HTTP status code of the response |
public function <Response res> getStringPayload() (string)
Gets the response payload as a string
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | The string representation of the message payload |
public function <Response res> getXmlPayload() (xml)
Gets the response payload in XML format
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
xml | The XML representation of the message payload |
public function <Response res> removeAllHeaders()
Removes all transport headers from the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
public function <Response res> removeHeader(string key)
Removes a transport header from the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
key | string | The header name |
public function <Response res> send() (HttpConnectorError)
Sends outbound response to the caller.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HttpConnectorError | Error occured during HTTP server connector send |
public function <Response res> send100Continue() (HttpConnectorError)
Sends a 100-continue response to the client.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | A response struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
HttpConnectorError | Returns an HttpConnectorError if there was any issue in sending the response. |
public function <Response res> setBinaryPayload(blob payload)
Sets a blob as the response payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | blob | The blob representation of the message payload |
public function <Response res> setHeader(string key, string value)
Sets the value of a transport header
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
key | string | The header name |
value | string | The header value |
public function <Response res> setJsonPayload(json payload)
Sets a JSON as the response payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | req: The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | json | The JSON payload object |
public function <Response res> setProperty(string propertyName, string propertyValue)
Sets a response property
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
propertyName | string | The name of the property |
propertyValue | string | The value of the property |
public function <Response res> setReasonPhrase(string reasonPhrase)
Sets a custom HTTP Reason phrase
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
reasonPhrase | string | Reason phrase value |
public function <Response res> setStatusCode(int statusCode)
Sets the HTTP status code of the response
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
statusCode | int | HTTP status code |
public function <Response res> setStringPayload(string payload)
Sets a string as the response payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | string | The string payload to be set |
public function <Response res> setXmlPayload(xml payload)
Sets an XML as the response payload
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
res | Response | The response message |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
payload | xml | The XML payload object |
public function <Session session> getAttribute(string attributeKey) (any)
Gets the named session attribute
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
attributeKey | string | HTTP session attribute key |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
any | HTTP session attribute value |
public function <Session session> getAttributeNames() (string[])
Gets the session attribute names
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string[] | Session attribute names array |
public function <Session session> getAttributes() (map)
Gets the session attribute key value pairs as a map
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
map | The map of session attributes key value pairs |
public function <Session session> getCreationTime() (int)
Gets the session creation time
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | Session creation time |
public function <Session session> getId() (string)
Gets the session cookie ID
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | Session ID |
public function <Session session> getLastAccessedTime() (int)
Gets the last time the sessions was accessed
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | Last accessed time of the session |
public function <Session session> getMaxInactiveInterval() (int)
Gets maximum inactive interval for the session. The session expires after this time period.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
int | Session max inactive interval |
public function <Session session> invalidate()
Invalidates the session and it will no longer be accessible from the request
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
public function <Session session> isNew() (boolean)
Checks whether the given session is a newly created session or an existing session
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
boolean | Indicates if the session is a newly created session or not |
public function <Session session> removeAttribute(string attributeKey)
Remove the named session attribute
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
attributeKey | string | Session attribute key |
public function <Session session> setAttribute(string attributeKey, any attributeValue)
Sets the specified key/value pair as a session attribute
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
attributeKey | string | Session attribute key |
attributeValue | any | Session attribute Value |
public function <Session session> setMaxInactiveInterval(int timeInterval)
Sets the maximum inactive interval for the session. The session expires after this time period.
Receiver:
Receiver Name | Data Type | Description |
---|---|---|
session | Session | A Session struct |
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
timeInterval | int | Session max inactive interval |
Connectors of ballerina.net.http package
public connector HttpClient (string serviceUri, Options connectorOptions)
Http client connector for outbound HTTP requests
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
serviceUri | string | Url of the service |
connectorOptions | Options | connector options |
action delete(string path, Request req)
The DELETE action implementation of the HTTP connector
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Resource path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action execute(string HTTPVerb, string path, Request req)
Invokes an HTTP call with the specified HTTP verb.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
HTTPVerb | string | HTTP verb value |
path | string | Resource path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action forward(string path, Request req)
forward action can be used to invoke an HTTP call with incoming request HTTPVerb
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Request path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action get(string path, Request req)
GET action implementation of the HTTP Connector
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Request path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action head(string path, Request req)
The HEAD action implementation of the HTTP Connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Resource path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action options(string path, Request req)
OPTIONS action implementation of the HTTP Connector
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Request path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action patch(string path, Request req)
The PATCH action implementation of the HTTP Connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Resource path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action post(string path, Request req)
The POST action implementation of the HTTP Connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Resource path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
action put(string path, Request req)
The PUT action implementation of the HTTP Connector.
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
path | string | Resource path |
req | Request | An HTTP Request struct |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
Response | The response message | |
HttpConnectorError | Error occured during HTTP client invocation |
Structs of ballerina.net.http package
public struct HeaderValue
Represents an HTTP header value
Fields:
Field Name | Data Type | Description |
---|---|---|
value | string | The value of header |
param | map | The param map of header |
public struct HttpConnectorError
HttpConnectorError struct represents an error occured during the HTTP client invocation
Fields:
Field Name | Data Type | Description |
---|---|---|
msg | string | An error message explaining about the error |
cause | error | The error that caused HttpConnectorError to get thrown |
stackTrace | StackFrame[] | Represents the invocation stack when HttpConnectorError is thrown |
statusCode | int | HTTP status code |
public struct Options
Options struct represents options to be used for HTTP client invocation
Fields:
Field Name | Data Type | Description |
---|---|---|
port | int | Port number of the remote service |
endpointTimeout | int | Endpoint timeout value in millisecond (default value: 60000 milliseconds) |
maxActiveConnections | int | The maximum number of active connections the connector can create (default value: -1, indicates that the number of connections is not restricted) |
keepAlive | boolean | Keep the connection or close it (default value: true) |
transferEncoding | string | The types of encoding applied to the request (default value: chunking) |
chunking | string | The chunking behaviour of the request |
httpVersion | string | The version of HTTP outbound request |
followRedirects | FollowRedirects | Redirect related options |
ssl | SSL | SSL/TLS related options |
retryConfig | Retry | Retry related options |
proxy | Proxy | Proxy server related options |
public struct Request
Represents an HTTP request message
Fields:
Field Name | Data Type | Description |
---|---|---|
remoteHost | string | host: The server host name |
port | int | The server port |
path | string | Resource path of request URI |
method | string | HTTP request method |
httpVersion | string | The version of HTTP |
userAgent | string | User-Agent request header |
restUriPostFix | string | host: The server host name |
headers | map | Request headers |
public struct Response
Represents an HTTP response message
Fields:
Field Name | Data Type | Description |
---|---|---|
statusCode | int | The response status code |
reasonPhrase | string | The status code reason phrase |
server | string | The server header |
headers | map | Response headers |
public struct Session
Represents an HTTP Session
Annotations of ballerina.net.http package
annotation configuration
Configuration for HTTP service
Attributes:
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 |
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 | boolean | |
transferEncoding | string | The types of encoding applied to the response |
chunking | string | The chunking behaviour of the response |
webSocket | webSocket | Annotation to define HTTP to WebSocket upgrade |
annotation resourceConfig
Configuration for HTTP resource
Attributes:
Attribute Name | Data Type | Description |
---|---|---|
methods | string[] | The array of allowed HTTP methods |
path | string | The path of resource |
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 |
annotation webSocket
Annotation to upgrade connection from HTTP to WS in the same base path.
Attributes:
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. |