如何在API蓝图中为每个端点指定多个请求类型?

时间:2014-02-10 20:51:42

标签: apiblueprint

是否可以定义当PUT to /asdf空请求正文发生时PUT to /asdf{ "value": "somthing" }的请求正文{{1}}发生时会发生什么。

1 个答案:

答案 0 :(得分:3)

假设两个请求的媒体类型相同且响应HTTP状态代码不同,这应该是合法的:

# PUT /asdf
+ Request Empty (application/json)
    + Headers

            Content-Lenght: 0

+ Response 400

+ Request With Value (application/json)

        { "value": "somthing" }

+ Response 204