I am relatively new to python and I am currently working on python 2.7.x with a legacy project. One of my requirement is to make an api request from code which I am doing through the requests.get method. Whats weird is I get the exception every single time for the api when I try to invoke it. Doing a curl or launching the api in browser works fine. What could be the issue here?I cannot move to newer python versions as this is a legacy project I am working on.What can I possibly do to fix this?
my code is
import requests
url="http://<ip>:<port>/api/x.x/yz"
r=requests.get(url)