Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.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
Http Swagger 2.0接受语言头作为请求参数_Http_Http Headers_Swagger_Http Accept Language - Fatal编程技术网

Http Swagger 2.0接受语言头作为请求参数

Http Swagger 2.0接受语言头作为请求参数,http,http-headers,swagger,http-accept-language,Http,Http Headers,Swagger,Http Accept Language,我正在使用Swagger 2.0为http API编写规范 如何将标头定义为路径所需的标头参数 /aPath: post: parameters: - in: header name: Accept-Language type: string enum: [de, en, es] required: true responses: 200: description: The Best schema:

我正在使用Swagger 2.0为http API编写规范

如何将标头定义为路径所需的标头参数

/aPath:
post:
  parameters:
    - in: header
      name: Accept-Language
      type: string
      enum: [de, en, es]
      required: true
  responses:
    200:
      description: The Best
      schema:
        type: string

Swagger规范对某些标题具有特殊关键字:


如何使用关键字PRODUCTS定义接受语言标题?

您的定义是正确的

您提到的页面讨论了标题,这与其他页面不同