我需要AWS Lambda函数重定向方面的帮助。 我有AWS Lambda Api端点URL,如下所示 https://xxxxx.execute-api.us-west.amazonaws.com/api/updatestats/click?url=yahoo.com
现在执行上面的AWS Lambda api代码后,我想获取查询参数“url”的值,并将lambda api端点url重定向到url,即yahoo.com
如果有人对此有所了解,请告诉我。
由于 拉朱
答案 0 :(得分:-1)
您可以在lambda函数中使用以下python代码实现此目的:
exports.handler = function(event, context) {
context.succeed({location: 'https://example.com'});
};
更多详细信息在这里描述: https://kennbrodhagen.net/2016/04/02/how-to-return-302-using-api-gateway-lambda/