gabriel_parrale
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2016
06:27 AM
Double quotes in url that returns json
I have the following:
request.SetUrl("https://.../veceditorial?filter={%22technical.deviceType%22:%22Browser%22,%22veceditorial.Categories%22:{%22$in%22:[%22Drama%22]}}&limit=1&....."
Return me invalid url,
In debugger mode appears the url, when assigning it as I have to get characters like double quotes, also probe with the following:
......filter={"+ Chr(34) + "technical.deviceType"+...
How can i get a valid url?
request.SetUrl("https://.../veceditorial?filter={%22technical.deviceType%22:%22Browser%22,%22veceditorial.Categories%22:{%22$in%22:[%22Drama%22]}}&limit=1&....."
Return me invalid url,
In debugger mode appears the url, when assigning it as I have to get characters like double quotes, also probe with the following:
......filter={"+ Chr(34) + "technical.deviceType"+...
How can i get a valid url?
1 REPLY 1
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2016
08:13 AM
Re: Double quotes in url that returns json
I have no idea what your 'filter' parameter is supposed to be, but whatever it is needs to be url-encoded:
If your filter thing is a JSON object, then convert it to a string before encoding:
Also, make sure that if you're using an https url then you call SetCertificatesFile:
filter = "{%22technical.deviceType%22:%22Browser%22,%22veceditorial.Categories%22:{%22$in%22:[%22Drama%22]}}"
request.SetUrl("https://.../veceditorial?filter=" + request.Escape(filter) + "&limit=1")
If your filter thing is a JSON object, then convert it to a string before encoding:
filter = FormatJson(filterJSON)
request.SetUrl("https://.../veceditorial?filter=" + request.Escape(filter) + "&limit=1")
Also, make sure that if you're using an https url then you call SetCertificatesFile:
request.SetCertificatesFile("common:/certs/ca-bundle.crt")