我们正在构建的API允许用户提供不同的请求主体。从我到目前为止看到/发现的情况来看,每个动作/资源只能提供一个请求。是否可以指定不同的请求体?
我尝试过:
### Create new line item for an existing order [POST]
Some description
+ Request (application/json)
### Create new line item and order [POST]
Some other description
+ Request (application/json)
还喜欢:
### Create new line item for an existing order [POST]
Some description
+ Request (application/json)
+ Request (application/json)
答案 0 :(得分:0)
您可以在一个操作中拥有多个请求和响应。请参阅下面的示例。
### Create new line item for an existing order [POST]
Some description
+ Request (application/json)
+ Response 200
+ Request (application/json)
+ Response 404
+ Request (application/xml)
+ Request (application/json)
+ Response 200