Monday, May 13, 2024
HomeiOS Developmentios - Ship URL request with out encoding Swift

ios – Ship URL request with out encoding Swift


I’m working with an API whose URL has the construction :-

http://abcd.efgh.com/authenticate?login={"username":"abcd","password":"dbca"}

The URL talked about above works and provides an applicable success response when despatched through Postman

When I attempt to ship a URL request with the URL above :-

let string = "http://abcd.efgh.com/authenticate?login={"username":"abcd","password":"dbca"}"
guard let url = URL(string: string) else { return nil }

the URL is being despatched as :-

http://abcd.efgh.com/authenticate?login=%7Bpercent22usernamepercent22:%22abcdpercent22,%22passwordpercent22:%22dbcapercent22percent7D

which the backend service doesn’t acknowledge.

Please recommendation if there’s a technique to carry out this URL request with out the URL being % encoded ? Ideally with out utilizing any third occasion library



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments