Reputation: 153
I want to send a request using these custom 2 Headers:
Host: website.com
Origin: anotherwebsite.com
Here is my python3 code:
headers = [("Host" , "https://website.com",
("Origin" , "https://evil.com")]
request = requests.get(site, headers=headers)
When executed it shows this error:
'list' object has no attribute 'items'
and it refers to this line request = requests.get(site, headers=headers)
Any help is highly appreciated, thank you in advanced.
Upvotes: 0
Views: 830
Reputation: 242
I usually use a dictionary:
headers = {
"Host": "https://website.com",
"Origin": "https://evil.com",
}
request = requests.get(site, headers=headers)
Upvotes: 1