Xenon
Xenon

Reputation: 11

Python requests library removes some characters in URL when sending request

I'm testing a web application and I need to send some malformed HTTP requests.

When I set URL to:

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

When I intercept the request in Burp Suite, I see that it removes the ? at the end.

The URL will be:

https://www.example.com/test

I need to send quotation mark and other things which will be removed by library.

Upvotes: 0

Views: 61

Answers (2)

Quackers
Quackers

Reputation: 127

A blank querystring is intentionally stripped. If you add some params (like https://www.example.com/test?exampleParam=true the querystring will not be stripped.

Source

Upvotes: 1

iCoderNet
iCoderNet

Reputation: 11

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

In Python requests, the above address is entered with params

import requests

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

Ishlatish bo'yicha qo'llanma

Upvotes: 0

Related Questions