I use Python 3 and the requests module/library for querying a REST service.
It seems that requests by default uses urllib.parse.quote_plus() for urlencodin
urllib.parse.quote_plus()
It turns out you can!
from requests.utils import requote_uri url = "https://www.somerandom.com/?name=Something Cool" requote_uri(url) 'https://www.somerandom.com/?name=Something%20Cool'
documentation here The requote_uri method is about halfway down the page.
requote_uri