可以使用Python中的requests库来发送HTTP请求。以下是完成上述功能的示例代码:

import requests

url = "http://localhost:8080/production-test/production/testresult/regInfo"
headers = {
    "cookie": "JSESSIONID=DBDFC9A42671C92B8EE65308F0F06591",
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
data = {
    "formData": "ids%5B%5D=4872&ids%5B%5D=4319"
}

response = requests.delete(url, headers=headers, data=data)

if response.status_code == 200:
    print("请求成功")
else:
    print("请求失败")

注意,此代码使用requests库发送HTTP DELETE请求,并在请求头中设置了cookie和Content-Type。请求内容作为data参数传递给请求。最后,根据响应的状态码判断请求是否成功。

Python DELETE 请求示例:使用 requests 库发送 HTTP DELETE 请求

原文地址: https://www.cveoy.top/t/topic/pzVv 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录