【发布时间】:2015-07-17 09:48:59
【问题描述】:
我想从我的 grape/rest api 返回原始数据/blob。
我关注了https://github.com/intridea/grape/issues/412的帖子
对于这样的代码:
get 'foo' do
content_type 'text/plain'
"hello world"
end
1) 我用过:格式'txt' - 我得到了引用的文字,例如:“hello world” 虽然浏览器没有错误,但 curl 给出 Content-Type: text/plain 但引号没有被删除
2) 环境['api.format'] = :txt 浏览器报错
3) content_type :txt, '文本/纯文本' 在浏览器错误数量的参数中给出错误
还有其他方法可以解决这个问题吗?
谢谢。
【问题讨论】:
标签: html ruby thin grape grape-api