How to handle to multiple content_types in one url?
leiwan5 opened this issue · comments
as respond_to in rails does?
Send headers like this. For HTML:
Req:ok([{"Content-Type", "text/html"}], "<b>hello</b>").
For Text:
Req:ok([{"Content-Type", "text/plain"}], "hello").
This is well documented, please read the documentation and the examples, I can scarcely see this as an 'issue'. :)
r.
Sorry, I didn't describe it clearly.
For example,
I know how to response different content-types. I want to know if there is an easy way to know what content-type the client want, or I can only parse the request header myself? or use different urls in the client, like '/users.html' and '/users.json'?