I want to return raw data/blob from my grape/rest api.
I followed the thread at : https://github.com/intridea/grape/issues/412
for a code like :
get 'foo' do
content_type 'text/plain'
"hello world"
end
1) I used : format 'txt' - I got quoted text like : "hello world" no error on the browser though, curl gives Content-Type: text/plain but the quotes are not removed
2) env['api.format'] = :txt gives error in browser
3) content_type :txt, 'text/plain' gives error in browser wrong number of args
Any other ways to fix this ?
Thanks.
body
that should do it according to the documentation. – Rummy