小编Jan*_*sen的帖子

如何在Swagger编辑器中使用Cookies

我想记录和测试一个API,它在http://editor.swagger.io/中使用基于Cookie的认证.举一个简单的例子:如何在下面的YAML中编写,/ login操作创建一个Cookie并且Cookie必须传递给/ showMySecretStuff?

swagger: '2.0'
info:
  title: Test API
  version: '1'
host: my.test.com
schemes:
  - https
basePath: /
consumes:
  - multipart/form-data
produces:
  - application/json
paths:
  /login:
    post:
      parameters:
        - name: username
          in: formData
          required: true
          type: string
        - name: password
          in: formData
          required: true
          type: string
          default: secret
      responses:
        200:
          description: OK
  /showMySecretStuff:
    get:
      responses:
        200:
          description: OK
Run Code Online (Sandbox Code Playgroud)

cookies swagger-editor

6
推荐指数
1
解决办法
1825
查看次数

标签 统计

cookies ×1

swagger-editor ×1