我们有一个现有的API,我们正在尝试为它构建一个蓝图,它要求某些请求主体是URI编码的JSON。
有没有什么方法可以将主体指定为“像这样,但经过编码”?
现有的(纯文本)文档只显示了JSON,并在发送之前给出了一个简单的提示来进行编码:
POST /blah/blah/blah
Content-Type: application/x-www-form-urlencoded
Parameters: (x-www-form-urlencoded)
{ "title": "Buy cheese and bread for breakfast." }但是使用Blueprint --尤其是apiary.io中的Blueprint--你真的必须展示真实的身体。是完全不可读的:
### Create a Note [POST]
+ Request (application/x-www-form-urlencoded)
%7B%20%22title%22%3A%20%22Buy%20cheese%20and%20bread%20for%20breakfast.%22%20%7D但在Blueprint中指定可读文本失败(返回参数错误):
### Create a Note [POST]
+ Request (application/x-www-form-urlencoded)
{ "title": "Buy cheese and bread for breakfast." }真正的症结是当我与我的真实服务器进行Apiary对话时:可读请求失败(因为它没有编码),而不可读请求成功(因为,正如需要的那样)。
发布于 2013-12-25 03:40:09
我相信这是还不支持的东西,但在这里正在跟踪:https://github.com/apiaryio/api-blueprint/issues/25
https://stackoverflow.com/questions/19919052
复制相似问题