Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/64.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 使用无服务器框架创建getMethod_Amazon Web Services_Serverless Framework - Fatal编程技术网

Amazon web services 使用无服务器框架创建getMethod

Amazon web services 使用无服务器框架创建getMethod,amazon-web-services,serverless-framework,Amazon Web Services,Serverless Framework,我使用无服务器框架。 我使用AWSAPI网关。 我想创建一个API,在终端输入该命令,并接收参数“name”和参数“type” 使用此命令,成功创建了API。 但是,没有设置任何参数。 因此,我在AWS控制台中手动设置参数。 但要等待正确的知识。 因此,使用无服务器框架不可能消除手动输入吗? 反映API网关中的参数设置如果有人知道如何编写yml,请告诉我 我想用curl轻松地实现API $ curl http://url.com/para?name=test&type=test 您需要

我使用无服务器框架。 我使用AWSAPI网关。 我想创建一个API,在终端输入该命令,并接收参数“name”和参数“type”

使用此命令,成功创建了API。 但是,没有设置任何参数。 因此,我在AWS控制台中手动设置参数。 但要等待正确的知识。 因此,使用无服务器框架不可能消除手动输入吗? 反映API网关中的参数设置如果有人知道如何编写yml,请告诉我

我想用curl轻松地实现API

$ curl http://url.com/para?name=test&type=test

您需要添加正确的标识:

functions:
  testfunc:
    handler: handler.func
    events:
      - http:
          path: testpath
          method: get
          request:
            querystrings:
              name: true
              type: true
            headers:
              Accept: application/json
functions:
  testfunc:
    handler: handler.func
    events:
      - http:
          path: testpath
          method: get
          request:
            querystrings:
              name: true
              type: true
            headers:
              Accept: application/json