zoukankan      html  css  js  c++  java
  • 使用 API Gateway 导入 API 对资源启用 CORS

    /users 
       options:
          summary: CORS support
          description: |
            Enable CORS by returning correct headers
          consumes:
            - application/json
          produces:
            - application/json
          tags:
            - CORS
          x-amazon-apigateway-integration:
            type: mock
            requestTemplates:
              application/json: |
                {
                  "statusCode" : 200
                }
            responses:
              "default":
                statusCode: "200"
                responseParameters:
                  method.response.header.Access-Control-Allow-Headers : "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'"
                  method.response.header.Access-Control-Allow-Methods : "'*'"
                  method.response.header.Access-Control-Allow-Origin : "'*'"
                responseTemplates:
                  application/json: |
                    {}
          responses:
            200:
              description: Default response for CORS method
              headers:
                Access-Control-Allow-Headers:
                  type: "string"
                Access-Control-Allow-Methods:
                  type: "string"
                Access-Control-Allow-Origin:
                  type: "string"
          responses:
            200:
              description: Default response for CORS method
              headers:
                Access-Control-Allow-Headers:
                  type: "string"
                Access-Control-Allow-Methods:
                  type: "string"
                Access-Control-Allow-Origin:
                  type: "string"
  • 相关阅读:
    uva11572 Unique Snowflakes
    codeforces#333 div2 B. Approximating a Constant Range
    uva11134 Fabled Rooks
    吐槽。。。
    uva 1605 Building for UN
    uva 120 Stacks of Flapjacks
    uva1152 4 Values whose Sum is 0
    uva817 According to Bartjens
    uva11214 Guarding the Chessboard
    无标题
  • 原文地址:https://www.cnblogs.com/cloudrivers/p/11620923.html
Copyright © 2011-2022 走看看