python发送delete请求一直不成功
importjsonfromurllibimportrequestids=element["id"]url2='http://xxxxx.xxxx/projects/'+...
import json
from urllib import request
ids = element["id"]
url2 = 'http://xxxxx.xxxx/projects/'+str(ids)+''
print(url2)
req = request.Request(url2,headers=header_dict)
response = request.urlopen(req)
request.get_method = lambda:'DELETE'
print(response.read().decode('utf-8'))
定义发送的请求为delete但是每次发送的还是post,python是3.7版本没有urllib2 展开
from urllib import request
ids = element["id"]
url2 = 'http://xxxxx.xxxx/projects/'+str(ids)+''
print(url2)
req = request.Request(url2,headers=header_dict)
response = request.urlopen(req)
request.get_method = lambda:'DELETE'
print(response.read().decode('utf-8'))
定义发送的请求为delete但是每次发送的还是post,python是3.7版本没有urllib2 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询