您需要在AWS API 网关中设置HTTP头。在您的集成请求中添加以下header属性可解决该问题:
名称:User-Agent
值:$context.identity.userAgent
例如,使用AWS CLI命令:
aws apigateway update-integration --region [region_name] --rest-api-id [rest_api_id] --resource-id [resource_id] --http-method [http_method] --patch-operations op='add',path='/requestParameters/method.request.header.User-Agent',value='$context.identity.userAgent'
需将[region_name]、[rest_api_id]、[resource_id]、[http_method]替换为相应的值进行使用。
上一篇:AWSapi网关自定义域名