How Does a Function Obtain the Request Path or Parameters When Using an APIG Trigger?
The request path or request parameters are carried in the input parameters of event by default. The input value of an APIG trigger is the event template of the function. For details about the event template, see Supported Event Sources.
How to obtain
The following are the formats for obtaining the request path and request parameters from the event object:
Format of the request path: event['path']
Format of the request parameter: event['queryStringParameters']['Parameter name']
How to call
You can call an API using its request path. Example: https://464d86ec641d45a683c5919ac57f3823.apig.projectID.com/apig-demo/subpath
You can also call the API by adding request parameters: https://464d86ec641d45a683c5919ac57f3823.apig.projectID.com/apig-demo/subpath?a=1&b=2

|
Parameter |
Description |
|---|---|
|
queryStringParameters |
Request parameter. Parameters following the URL in a GET request. When a GET request is initiated, the parameters are transferred in the form of a URL string. That is, the character string after the question mark (?) are the request parameters and are separated by &. |
|
path |
Request path. Access address of the API. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot