how to send this RAW request in python (not via requests, not specifying headers, just…
- User
how to send this RAW request in python (not via requests, not specifying headers, just this one string)
req = b'''GET https://yandex.com/ HTTP/1.1 host: yandex.com upgrade-insecure-requests: 1 user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7 sec-fetch-site: same-origin sec-fetch-mode: navigate sec-fetch-user: ?1 sec-fetch-dest: document sec-ch-ua: "Chromium";v="123", "Not:A-Brand";v="8" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "Windows" referer: https://yandex.com/ accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9'''
- Assistant
To send a raw HTTP request in Python without using the library or manually setting each header, you can achieve this by using the module. This approach allows you to send the exact bytes of your raw HTTP request to a server. Below is how you can do it: