我们正在研究使用 API 蓝图。在某些情况下,我们希望在 Request 的基础上得到 Response。所以,任何人都知道我们如何在 API Blueprint 中做到这一点。
问问题
96 次
1 回答
1
是的,这是受支持的,请参阅这篇文章:处理单个资源上的多个操作
You can write multiple Request(s) *and/or* Response(s). It is especially suitable for handling multiple types of Content-Type header.
# Message [/messages/{id}]
This resource represents one particular message identified by its *id*.
## Retrieve Message [GET]
+ Response 200 (application/json)
{"message":"Hello World!"}
+ Response 200 (text/plain)
Hello world!
+ Response 401 (text/plain)
There is no such a message for you, dear guest.
+ Response 410
The message you are searching for does not exist anymore.
于 2015-05-28T11:11:32.643 回答