Calls a specified function.
Request syntax
POST /2019-09-30/functions/Function/invocations HTTP/1.1
Cookie: Cookie
Payload
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
Function | String | Yes | The information about the function to be called. Two ARN formats are available:
Notice The ARN format must match the following regular expression pattern:
|
Cookie | String | Yes | The authentication cookie generated when the CreateAuthCookie API operation is called. |
Payload | JSON | Yes | The Payload content is passed to the function without modifications. |
Response syntax
HTTP/1.1 StatusCode
X-Fc-Error-Type: ErrorType
Payload
Response Parameters
Parameter | Type | Description |
---|---|---|
StatusCode | Number | The HTTP status code. If the request is successful, 200 is returned. If the request fails, other status codes are returned. For information, see Status codes. |
ErrorType | String | The error type. This parameter appears when a function encounters an error. The parameter
has the following two values:
|
Payload | JSON | The content returned by the function or the error message that is in the following Payload format. |
The format of the returned Payload is as follows:
{
"Message": "string",
"StackTrace": []
}
Example
$ curl -i -b token.cookie -k -X POST https://127.0.0.1:9999/2019-09-30/functions/service:helloworld:function:helloworld/invocations
HTTP/1.1 200 OK
Server: openresty/1.13.6.2
Date: Tue, 19 Nov 2019 09:25:42 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
HelloWorld