GET Search + Converts to White Space

I am trying to use a GET service with a search keyword like "R + Co" specified in the url. But the service gets like "R Co", which affects the search logic. Can we read this as a “+" in a service? Thanks at Advance !!

Edit: The service is being called from iOS.

+4
source share
3 answers

On iOS, you can encode url string in UTF8 as

NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+3
source

Use URL encoding when making a GET request.

See link

Encode query String parameter, which is your search keyword.

URLEncoder.encode("R+Co","UTF-8");
+2
source

ASCII Encoding Reference. "+" "%2B". "R + Co" , "R% 2BCo".

+1
source

Source: https://habr.com/ru/post/1628920/


All Articles