InvokeFunction
Updated at:
Invokes a specified function.
Request syntax
POST /2020-04-30/functions/Function/invocations HTTP/1.1
Cookie: Cookie
PayloadImportant
2020-04-30 is the version number of the edge OpenAPI. This value cannot be changed.Request parameters
| Parameter Name | Type | Required | Description |
| Function | String | Yes | The information about the function to invoke. The function can be specified in one of the following two ARN formats:
Important The ARN format must match the following regular expression pattern.
|
| Cookie | String | Yes | The authentication cookie created by calling the CreateAuthCookie operation. |
| Payload | JSON | Yes | The content of the payload is passed to the function without modification. |
Return syntax
HTTP/1.1 StatusCode
X-Fc-Error-Type: ErrorType
PayloadResponse parameters
| Parameter Name | Type | Description |
| StatusCode | Number | The HTTP status code. A value of 200 indicates that the call is successful. Other values indicate that the call failed. For more information, see Status codes. |
| ErrorType | String | This parameter is returned when an error occurs during function execution. It can be one of the following values:
|
| Payload | JSON | The content that the function returns. If an error occurs, this parameter contains an error message. |
The response payload is in the following format.
{
"Message": "string",
"StackTrace": []
}Examples
$ curl -i -b token.cookie -k -X POST https://127.0.0.1:9999/2020-04-30/functions/service:helloworld:function:helloworld/invocations
HTTP/1.1 200 OK
Server: openresty/1.13.6.2
Date: Tue, 21 Apr 2020 14:37:38 GMT
Content-Type: text/plain; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Hello WorldIs this page helpful?