let ids = [String: [String]]
ids=%5B%4566abef1c-4462-4g62-bcc5-5ae10547104c%22,%20%1256efcf8c-6977-430d-b3ec-4ae80547101c%22%5D
After appended and passing url params, response failing in response structure special symbol added in -> %5B%%
https://baseUrl/endpoint?ids=4566abef1c-4462-4g62-bcc5-5ae10547104c,1256efcf8c-6977-430d-b3ec-4ae80547101c
How to remove %22%5D from url?
Here Code:
let parms: [String: [String]]
let urlString = "(baseUrl)/(endpoint)"
Connector.requestSwiftyJson(
url: urlString,
requestType: .get,
withParams: parms,
loader: false
) { json, response, error in
3
Answers
you can remove unwanted characters by adapting the parameters right before passing it into the parser like:
"…How to remove
%22%5D
from url? ". Try this:You can also remove all percent encoding using this:
There is an API to remove the percent encoding
However if you need to extract the UUIDs you can do it with Regular Expression
Note: the
g
in the first UUID is an invalid character