forum

Home / DeveloperSection / Forums / How to add a URL String in a JSON object

How to add a URL String in a JSON object

Anonymous User 2302 16-Dec-2015
I need to add a URL typically in the format http:\somewebsite.com\somepage.asp. When I create a string with the above URL and add it to JSON object json

using

json.put("url",urlstring);
it's appending an extra "\" and when I check the output it's like http:\\somewebsite.com\somepage.asp

When I give the URL as http://somewebsite.com/somepage.asp the json output is http:\/\/somewebsite.com\/somepage.asp

Can you help me to retrieve the URL as it is, please?

java java  json 
Updated on 16-Dec-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By