I\'m trying to build a simple proxy using Flask and requests. The code is as follows:
@app.route(\'/es///
My use case is to call another API in my own Flask API. I'm just propagating unsuccessful requests.get
calls through my Flask response. Here's my successful approach:
headers = {
'Authorization': 'Bearer Muh Token'
}
try:
response = requests.get(
'{domain}/users/{id}'\
.format(domain=USERS_API_URL, id=hit['id']),
headers=headers)
response.raise_for_status()
except HTTPError as err:
logging.error(err)
flask.abort(flask.Response(response=response.content, status=response.status_code, headers=response.headers.items()))