emil emil - 1 year ago 197
HTTP Question

How to get http headers in flask?

I am newbie to python and using Python Flask and generating REST API service.

I want to check authorization header which is sent by angularjs.

But I can't find way to get HTTP header in flask.

Any help for getting HTTP header authorization is appreciated.

Answer Source
from flask import request

request.headers is a dictionary, so you can also get your header like you would any dictionary:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download