Passing URL parameters in iOS webview


#1

Hi,

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: https://www.hello.com?key1=very
But this does not: https://www.hello.com?key1=very 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.


#2

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?


#3

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.

Thanks


#4

Happy to help. Good job making the adjustment.