【发布时间】:2018-03-14 18:23:38
【问题描述】:
我正在使用 Swagger 2.0 创建 python-flask 后端的框架。
我在 Swagger 在线编辑器上声明了POST /image 端点:
/image:
post:
summary: "Description."
operationId: "image_post"
consumes:
- "multipart/form-data"
parameters:
- in: "formData"
name: "upfile"
description: "The file to upload."
required: true
type: "file"
responses:
201:
description: "Ok"
schema:
type: "string"
400:
description: "bad image"
x-swagger-router-controller: "swagger_server.controllers.default_controller"
下载python-flask 服务器后,我使用命令python -m swagger_server 运行它。通过邮递员发送帖子请求时,我得到状态代码是200 而不是201。它还在运行服务器的命令行上显示200。
如果这是一个错误,有什么线索吗?还是我做错了什么?
【问题讨论】:
标签: python flask swagger http-status-codes