0
我們正在研究使用API藍圖。有些情況下我們希望根據請求獲得迴應。因此,任何人都知道我們如何在API藍圖中做到這一點。如何獲得API藍圖中的請求響應
我們正在研究使用API藍圖。有些情況下我們希望根據請求獲得迴應。因此,任何人都知道我們如何在API藍圖中做到這一點。如何獲得API藍圖中的請求響應
是的,這是支持的,看到這篇文章:Handling multiple actions on a single resource
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.