我已尝试使用python创建一个特定的GET请求来访问该站点: https://sgfm.elcorteingles.es/SGFM/dctm/MEDIA03/202006/24/00117731276964____5__210x210.jpg
但是我没有收到任何来自浏览器的响应,它一直在等待。 然后我尝试创建一个curl请求,同样的事情发生了(一直在等待)。 在所有这些之后,我尝试创建一个邮递员请求,它工作得非常完美!我不明白为什么它可以与postman一起使用,而不能与python和curl一起使用,因为所有这些平台都不像浏览器。 我使用postman方法将postman请求转换为python和curl:
#python
import requests
url = "https://sgfm.elcorteingles.es/SGFM/dctm/MEDIA03/202006/24/00117731276964____5__210x210.jpg"
payload = {}
headers= {}
response = requests.request("GET", url, headers=headers, json = payload)
print(response.text.encode('utf8'))
#curl
curl --location --request GET 'https://sgfm.elcorteingles.es/SGFM/dctm/MEDIA03/202006/24/00117731276964____5__210x210.jpg'
但他们都没有得到任何回应。 有人知道为什么会发生这种情况并将其转换为python请求吗?甚至卷曲我也能处理
服务器不接受您的标题。我试过这些,它对我有效
此外,您还需要将所做的请求更改为
requests.requests('GET')
不是发出GET
请求的正确方式。正确的是requests.get(ur;)
相关问题 更多 >
编程相关推荐