更新时间:2023-08-09 GMT+08:00
测试函数
- 测试托管方式改造函数,调用方法如图1所示。
- 测试独立函数。
- 统一使用POST请求。
- 请求url为添加事件源创建的APIG触发器地址。
- Body体参考如下格式进行配置,如图3所示,在函数代码中可以根据需要,通过APIGTriggerEvent对象获取相应的值。
{ "body": "xxxxxx", "requestContext": { "apiId": "xxxx", "requestId": "xxxxx", "stage": "RELEASE" }, "queryStringParameters": { "responseType": "html" }, "httpMethod": "POST", "pathParameters": {}, "headers": { "accept-language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2", "accept-encoding": "gzip, deflate, br", "x-forwarded-port": "443", "x-forwarded-for": "xxxxxx", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "upgrade-insecure-requests": "1", "host": "xxxxxxxx", "x-forwarded-proto": "https", "pragma": "no-cache", "cache-control": "no-cache", "x-real-ip": "xxxxxxxx", "user-agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0" }, "path": "", "isBase64Encoded": true }
父主题: MFA微服务serverless化