更新时间:2023-12-07 GMT+08:00
分享

x-apigateway-backend.httpEndpoints

含义:API网关定义的HTTP类型API后端服务定义。

作用域x-apigateway-backend

示例

paths:
  '/users/{userId}':
    get:
      produces:
        - "application/json"
      parameters:
        - name: "X-Auth-Token"
          description: "认证token"
          type: "string"
          in: "header"
          required: true
      responses:
        default:
          description: "default response"
      x-apigateway-request-type: "public"
      x-apigateway-backend:
        type: "HTTP"
        httpEndpoints:
          address: "example.com"
          scheme: "http"
          method: "GET"
          path: "/users"
          timeout: 30000
表1 参数说明

参数

是否必选

类型

说明

address

Array

后端服务地址,格式为:<域名或IP>:[port]

scheme

String

后端请求协议定义,支持http、https

method

String

后端请求方法,支持GET、POST、PUT、DELETE、HEAD、OPTIONS、PATCH、ANY

path

String

后端请求路径,支持路径变量

timeout

Number

后端请求超时时间,单位毫秒,缺省值为5000,取值范围为1 ~ 60000

分享:

    相关文档

    相关产品