Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 如何在AWS API网关HTTP API中设置路径变量?_Amazon Web Services_Api_Http_Aws Lambda_Gateway - Fatal编程技术网

Amazon web services 如何在AWS API网关HTTP API中设置路径变量?

Amazon web services 如何在AWS API网关HTTP API中设置路径变量?,amazon-web-services,api,http,aws-lambda,gateway,Amazon Web Services,Api,Http,Aws Lambda,Gateway,我一直在玩AWSAPI网关中的HTTP API,似乎无法让带有路径变量的路由正常工作。这是我的设置: 这是lambda的Python代码: import json def lambda_handler(event, context): # TODO implement return { 'statusCode': 200, 'body': json.dumps(event) } 非常简单,因为设置看起来非常简单。我得到了查询字符串参数,可以毫无问题地工作

我一直在玩AWSAPI网关中的HTTP API,似乎无法让带有路径变量的路由正常工作。这是我的设置:

这是lambda的Python代码:

import json

def lambda_handler(event, context):
  # TODO implement
  return {
      'statusCode': 200,
      'body': json.dumps(event)
  }
非常简单,因为设置看起来非常简单。我得到了查询字符串参数,可以毫无问题地工作,但不是这个

这是来自
/helloworld/1
的响应:

{"message":"Internal Server Error"}
更新:没有真正找到解决这个问题的方法,最终选择了RESTAPI解决方案