NetworkLayer icon indicating copy to clipboard operation
NetworkLayer copied to clipboard

"@" turn into "%2540" while making a network request.

Open hasankamrul opened this issue 5 years ago • 2 comments

when I am sending email as a parameter it converts "@" into "%2540" in url. example: [email protected] turn into test%2540gmail.com in url. I found the reason is because of double encoding, but can't find any solution. https://stackoverflow.com/questions/25393229/40-on-click-turns-to-2540

hasankamrul avatar Sep 12 '20 11:09 hasankamrul

when I am sending email as a parameter it converts "@" into "%2540" in url. example: [email protected] turn into test%2540gmail.com in url. I found the reason is because of double encoding, but can't find any solution. https://stackoverflow.com/questions/25393229/40-on-click-turns-to-2540

Hey man!! Did you find any solution? Facing the exact issue.

neerajk207 avatar Nov 17 '20 17:11 neerajk207

when I am sending email as a parameter it converts "@" into "%2540" in url. example: [email protected] turn into test%2540gmail.com in url. I found the reason is because of double encoding, but can't find any solution. https://stackoverflow.com/questions/25393229/40-on-click-turns-to-2540

If you're following the same Folder/File structure, You can fix it by editing the file URLParameterEncoder.swift as follows:

Replace let queryItem = URLQueryItem(name: key, value: "\(value)".addingPercentEncoding(withAllowedCharacters: .urlHostAllowed))

to

let queryItem = URLQueryItem(name: key, value: "\(value)")

Hope it helps.

neerajk207 avatar Nov 19 '20 09:11 neerajk207