1

我们正在构建的 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)
4

1 回答 1

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
于 2014-07-28T12:00:54.757 回答