Python requests 库在发送请求时删除 URL 中的一些字符

问题描述 投票:0回答:2

我正在测试一个 Web 应用程序,我需要发送一些格式错误的 HTTP 请求。

当我将 URL 设置为:

URL = https://www.example.com/test?

当我在 Burp Suite 中拦截请求时,我看到它删除了末尾的

?

网址为:

https://www.example.com/test

我需要发送引号和其他内容,这些内容将被图书馆删除。

python python-requests
2个回答
1
投票

故意删除空白查询字符串。如果您添加一些参数(例如

https://www.example.com/test?exampleParam=true
,查询字符串将不会被删除。

来源


0
投票
https://www.example.com/test?txt=hello

在Python请求中,上面的地址是用params

输入的
import requests

x = requests.get('https://www.example.com/test', params={'txt': 'hello'})
print(x.status_code)

Ishlatish bo'yicha qo'llanma

© www.soinside.com 2019 - 2024. All rights reserved.