0
我必须在Python中使用使用urllib.request的POST方法,并为POST方法编写了以下代码。我们如何在Python中使用POST方法使用urllib.request?
values = {"abcd":"efgh"}
headers = {"Content-Type": "application/json", "Authorization": "Basic"+str(authKey)}
req = urllib.request.Request(url,values,headers=headers,method='POST')
response = urllib.request.urlopen(req)
print(response.read())
我能够利用“GET”和“删除”但不“POST” .Could任何人帮我解决这个? 谢谢
在问题中添加'url',它是什么? – bhansa