Passing URL parameters in iOS webview



I would like to pass a string that contains a space, however, as i am passing it now, the web view does not appear to allow loading the URL if it contains a space. I believe I have done it successfully on the Android web view, and can’t see that I am doing it any differently now.

So for example this works:
But this does not: spacy

  • All the values are defined as strings.

Is there a way to let the web view accept such a URL or modify the string to make it fit into a URL parameter?

Thank you for your time.


Hmm… It’s odd that you have a space in an URL first off. That’s not really a thing but I believe you can encode spaces using the %20 in it. Still a very uncommon move here but maybe this helps you?


Yeah, i realized it was just poor practice from my side. I ended up passing the id of the item and have the backend look up the values based on that ID instead. Fewer parameters and no spaces.



Happy to help. Good job making the adjustment.