I am trying to create an endpoint where the response body is just a string with line breaks, but the response keeps showing the \n character.
My endpoint code:
get '' do
header('Content-Type', 'text/plain')
body("Hello\nWorld")
end
And this is the response I see in Postman:
What am I missing here?
Thank you
I was able to make it work like I wanted with the following code:
get '' do
env['api.format'] = :binary
header('Content-Type', 'text/plain')
body("Hello\nWorld")
end