urllib: TypeError: expected string or bytes-like object
urllib: TypeError: expected string or bytes-like object Question: I am trying to make an API call where I pass a file in the header import urllib.request headers = {‘files[]’: open(‘File.sql’,’rb’)} datagen ={} request = urllib.request.Request(‘https://www.rebasedata.com/api/v1/convert’, datagen, headers) response1 = urllib.request.urlopen(request) # Error : TypeError: expected string or bytes-like object response2 = urllib.request.urlopen(‘https://www.rebasedata.com/api/v1/convert’, datagen, headers) #Error: …