Created
October 23, 2015 21:26
-
-
Save pengwynn/1b0e8f42bd6f0c1b6299 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pretty = user_agent.cli? || user_agent.browser? | |
extra_newline = pretty ? "\n" : "" | |
body = custom_content_type ? obj : encode_json(obj, :pretty => pretty) + extra_newline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment