rbw152 Member Licensed User Longtime User Mar 16, 2016 #1 Hi all, Just quickly wondering if there's a way to make StringUtils UrlEncode make spaces into '%20' instead of '+'. I'm trying to download a pdf file using its URL and it won't find the file with the '+' but if I replace with a '%20' in the address bar, all goes well. Thanks in advance!
Hi all, Just quickly wondering if there's a way to make StringUtils UrlEncode make spaces into '%20' instead of '+'. I'm trying to download a pdf file using its URL and it won't find the file with the '+' but if I replace with a '%20' in the address bar, all goes well. Thanks in advance!
somed3v3loper Well-Known Member Licensed User Longtime User Mar 16, 2016 #2 Did you try this ? Code: Copy job.Download2(link,array as string("parameter1","value1","parameter2","value2")) Upvote 0
Did you try this ? Code: Copy job.Download2(link,array as string("parameter1","value1","parameter2","value2"))
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2016 #3 + is the correct escape value for spaces in the query parameters. You can replace the + with %20: Code: Copy encodedUrl = encodedUrl.Replace("+", "%20") Upvote 0
+ is the correct escape value for spaces in the query parameters. You can replace the + with %20: Code: Copy encodedUrl = encodedUrl.Replace("+", "%20")
rbw152 Member Licensed User Longtime User Mar 17, 2016 #4 Erel said: + is the correct escape value for spaces in the query parameters. You can replace the + with %20: Code: Copy encodedUrl = encodedUrl.Replace("+", "%20") Click to expand... Well that seems to work, thanks. Just wondering why it won't work with + but does with %20. If + is the correct value, why do I need to replace the + every time? Upvote 0
Erel said: + is the correct escape value for spaces in the query parameters. You can replace the + with %20: Code: Copy encodedUrl = encodedUrl.Replace("+", "%20") Click to expand... Well that seems to work, thanks. Just wondering why it won't work with + but does with %20. If + is the correct value, why do I need to replace the + every time?
lemonisdead Well-Known Member Licensed User Longtime User Mar 17, 2016 #5 rbw152 said: If + is the correct value, why do I need to replace the + every time? Click to expand... Because %20 is not the "correct" value : it is an admitted value (RFC 1738) Upvote 0
rbw152 said: If + is the correct value, why do I need to replace the + every time? Click to expand... Because %20 is not the "correct" value : it is an admitted value (RFC 1738)