Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty viewer for JSON response doesn't decode escape characters #924

Closed
farin opened this issue Feb 18, 2015 · 10 comments
Closed

pretty viewer for JSON response doesn't decode escape characters #924

farin opened this issue Feb 18, 2015 · 10 comments
Labels

Comments

@farin
Copy link

farin commented Feb 18, 2015

Eg. raw json
{"links":[{"href":"http://localhost:5000/api_1_0/images","rel":"self"}]}

in pretty print, html link still contains escaping backslashes instead real text value
(according to json spec forward slashes can be escaped but it's not mandatory. Some libraries, like python ujson, produce jsons with such escape characters)

@farin farin changed the title JSON reponse pretty viewer don't decode escape characters pretty viewer for JSON response doesn't decode escape characters Feb 18, 2015
@ivan-novakov
Copy link

+1

It would be nice to have the option to "switch on/off" URL slash escaping.

@bazted
Copy link

bazted commented Mar 28, 2015

The most strange thing is that in Postman - REST Client(not packaged app) URL is parsed correctly and can be even clicked. It is strange that packaged app has this bug.

@cameron-fgx
Copy link

+1

The issue isn't only on the "pretty" viewer, raw and preview are also escaped.

@kevinvanmierlo
Copy link

+1

This is a thing that really bugs me

@cnanney
Copy link

cnanney commented Jul 7, 2015

Yeah, "raw" is not really raw when displaying "Token":"oe0/18uk" as "Token":"oe0\/18uk"

@abhijitkane
Copy link
Member

@cameron-fgx @cnanney What version of Postman are you on?

In 3.0.2, a server response of {"Token":"oe0/18uk"} is rendered as-is in the raw view and preview.

@cnanney
Copy link

cnanney commented Jul 7, 2015

My mistake, this is not a Postman problem. Apparently the API is escaping forward slashes in the JSON response, so the actual value of oe0/18uk is being returned and displayed as oe0\/18uk in Postman raw and preview tab, and oe0\\/18uk in pretty.

When I use the "copy response" button from from any view, the escaping is removed and oe0/18uk is in my clipboard.

Is there a way for Postman to detect the escaped slashes and display it properly in the pretty tab? Raw should be the actual raw response, but in pretty can it unescape the slashes?

@cnanney
Copy link

cnanney commented Jul 23, 2015

This is now worse in 3.0.5.

A response of {"Token":"oe0\/18uk"} is still displayed in all views as {"Token":"oe0\\/18uk"}, but is also now copying response to clipboard as {"Token":"oe0\\/18uk"}, where before it smartly removed all escaping nonsense and copied {"Token":"oe0/18uk"} to clipboard.

I think in Pretty and Preview view, it should properly unescape all these entities, so a\/e displays as a/e. Raw should always show the raw response. Same for copying to clipboard... If you copy from pretty/preview, it copies with the decoded escape characters, but raw copies the raw response.

@abhijitkane
Copy link
Member

@cnanney Can you confirm this fixed in 3.2.8 of the app?

@cnanney
Copy link

cnanney commented Dec 29, 2015

In 3.2.8 (packaged), this is resolved. I do notice that the "copy response to clipboard" button always produces the same output, rather than copying the raw response if you are viewing the raw tab when you press the button.

This is no big deal, because if you want the actual raw data, you can always just manually copy and paste it from the textarea.

@a85 a85 added transfer and removed transfer labels Jan 27, 2016
@a85 a85 closed this as completed Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants