Reputation: 12423
I have this python code.
from urllib import request
req = request.Request(url, data={})
req.add_header('Referer', 'my_original_header')
res = request.urlopen(req)
However it send the post request to this url.
SO I try this instead
res=request.get(url, headers={"Referer":"my_original_header"})
However it shows there is no get
method
Upvotes: 0
Views: 51
Reputation: 36
to use the method .get try using a module called requestS.
import requests
res=requests.get('https://3dthings.online', headers{"Referer":"my_original_header"})
res.content
Upvotes: 1