Search code examples
python-3.xpython-requestshttp-status-code-404python-responses

Python request gives 404 response, but I get 200 when I run the code from local server


I have used python requests before. However, now I am facing a 404 problem on this specific site Jiomart.com.

When I try to sent requests from my local server, it gives me 200 as the response. After when I completed the project and deployed it on the Digital Ocean server, I am getting 404 as the response. I don't know why. Did anyone experience the same issue? Instead of Jiomart.com all other sites I am getting 200 as response.

My system configuration Python 3.8.6, Ubuntu 20.0, Python Requests

site = requests.Session()
res = site.get('https://www.jiomart.com/')
print(res)

Solution

  • If you put that URL through a service that allows you to preview the site from different geographic locations, you'll see that it's georestricted using Amazon Cloudfront's geo blocking feature.