Question

I am using the twitter API, and when I make a request to the api website, something like https://api.instagram.com/v1/tags/cats/media/recent?user_id=myUserId&count=1

I get the correct response back, JSON data, except all of the // characters are escaped and are shown as \/\/

This is true for the command line, using curl and when i type that url directly into the browser.

If it makes any difference, I am ultimately going to be calling a function and navigating to that URL so I need it to be the unescaped.

Furthermore, I will be accessing that URL with Python, so if there is a Python method that is good, but ideally I would just get the response back unchanged.

Was it helpful?

Solution

The JSON standard allows (though not requires) / to be escaped. If you use any standard-compliant JSON parser (i.e. pretty much any JSON parser), it will do the unescaping for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top