Skip to content

content_type is not automatically set #185

brandonweiss opened this Issue Mar 14, 2012 · 4 comments

3 participants


I'm not sure if this is intended or not, but I was surprised to see RABL setting the content_type to text/html when the format was set to JSON. I wound up having to manually set the content_type for all responses to application/json. Is this a bug, working as intended, or am I doing something wrong?


I use sinatra and rabl together mostly and I just set the content type in a before filter. If RABL did set the content type, I would want that to support Rails, Sinatra and Padrino. Right now its left up to the user since rabl supports json/xml/msgpack/etc it was something that was never automated. Patches welcome though :)


Ah yeah, in retrospect that makes sense, I just wasn't expecting it. That should probably be added to the readme so other people don't get bit by it, until RABL detects frameworks and sets it accordingly.


Good idea, I will add it to the readme soon, thanks for the feedback

databyte commented Apr 6, 2012

README was updated, closing.

@databyte databyte closed this Apr 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.