I am trying to convert working Python 2.7 code into Python 3 code and I am receiving a type error from the urllib request module.
I used the inbuilt 2to3 Python tool
Try this:
url = 'https://www.customdomain.com' d = dict(parameter1="value1", parameter2="value2") f = urllib.parse.urlencode(d) f = f.encode('utf-8') req = urllib.request.Request(url, f)
Your problem lies in the way you were handling the dictionary.