insomnia
insomnia copied to clipboard
[Enhancement] Friendlier JSON in Preview mode
It looks like Insomnia always escapes the forward slash:
\/
Can this be an option in the response window, or the IDE as global option?
This bit us, as a very long encoded value was behaving one way in Insomnia (escaping the forward slash), but was different in another REST client (Postman: it doesn't escape forward slashes).
Thanks!
👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. If you're requesting a feature 🎁, please provide real use cases that would benefit. 👪
To help make this a smooth process, please be sure you have first read the contributing guidelines.
Where are you seeing the forward slash being escaped?
In the response, in the content of a string property: i.e. {"prop": "a\/string\/field"}
when we're expecting it to be {"prop": "a/string/field"}
-- thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Just trying Insomnia for the first time. Gorgeous -- nice work! We're having this issue as well. We return links in our payload in relative form (no scheme or authority). All forward slashes are rendered as escaped making them not clickable.
The same issue for me. Option for disabling of escaping all forward slashes would be very nice.
I think having the Preview show more friendly JSON could be a good idea
Any progress on this?
Hello everyone, will this be fixed?
I am still getting escape URL/links.
Will it be possible to not show these escaped?
Almost a year and no progress on this ?
Adding label for investigation / verification after attempting to replicate and being unable to do so.
Can someone who is encountering this document the steps to replicate along with the request / response body and headers used to replicate - preferably with screenshots.
It seems like an edge-case or misconfigured settings / content-types, see screenshot below where my slashes are not escaped:

Pasting from the preview pane also does not result in slashes:
"prop": "hello/world/there"
There is no misconfiguration at all. I even have installed Insomnia on a brand new PC and without have setting anything URLs are all escaped. Do a request to an API that is reponding an URL and you will see it escaped. Simple as that. The content-type I was using was a simple application/json and probably the most common out there.
@K2ouMais I hear you but without proper steps to replicate and exact information it makes it difficult to work on. What version of Insomnia are you running and what is the url, request body, and headers you are requesting with, as I cannot replicate the issue.
Ok, it is really late here. I will try to give you a proper example tomorrow.
maybe http://mockbin.org/ will be useful in simulating such a response
Here is a good example: GET https://api.gleif.org/api/v1/entity-legal-forms
Escaped URLs:
Headers:
Preferences using the newest Insomnia version:
This API has probably a Laravel Backend.
I am seeing the same behaviour on my API with a Laravel Backend.
I dont know if this could be the problem.
If I use the exact same example in Postman, every link seems to be right.
@dimitropoulos @nijikokun I have inserted a proper API where the URLs are escaped. Could you please take a look at it?
Thank you
Having the same issue :( still no fix?
Nope. They wanted me to show them the problem and since then nothing.
It has been a month.
Nope. They wanted me to show them the problem and since then nothing.
It has been a month.
Sad, i really like Insomnia over Postman but this...
I've the same issue. Postman works fine for same API. Insomnia please fix it.
Same here, spent several hours to undestand why the token I request is not valid with Insomnia but it is with Postman. It was just because forward slash is escaped :
@sgostanyan very sorry to hear that you lost time due to this. I've asked internally if we can get this prioritized in some way.
@K2ouMais sorry on the dealyed response. A bot to mark issues got enabled which flooded my inbox with 600+ issues from insomnia and your response here got lost in the shuffle.
I think I understand what's going on.
So first off, the response you gave includes the escapes
Here's an example with just curl
Here's an example from chrome:
And, indeed, here's an example from Postman:
The difference here is that in our "Preview" mode, which is sorta like a pretty print, we use the JSON.stringify behavior.
For example,
For this behavior to change, we'd need to update something around here: https://github.com/Kong/insomnia/blob/develop/packages/insomnia-app/app/ui/components/codemirror/code-editor.tsx#L634
I made a mockbin we can use for this: http://mockbin.org/bin/6f5df8ac-8fa4-4aa0-8961-d01ed9f29d7a
Any progress on this? I could take a stab at a PR, but, not being at all familiar with the codebase, I'd probably do it wrong.
Still no progress ?
Is there any chance this issue can be prioritised? I'm really not sure why forward slashes in network responses are being escaped in the Preview tab.
i think someone has addressed this kind issue long ago and it has been closed 🤔 pls check this @jvukovich link-issue
Thanks, I wasn't aware of the other closed issue.
Well, there looks like there are quite a few recent follow-ups on that closed issue, too, particularly mrjimhubbard's suggestion:
Should we not leave this issue open if enough people are rallying around making this clearer/easier/user-friendly?