xxxxxxxxxx
from flask import request
request.headers.get('your-header-name')
# This returns None if you don't have the header
# You can specify what it returns by default by doing this:
request.headers.get('your-header-name', 'non-exist return')
xxxxxxxxxx
from flask import request
import sys #for printing in log console
print(request.headers, file=sys.stderr)
xxxxxxxxxx
from flask import request
@app.route('/')
def index():
for key, value in request.headers.items():
print(f"{key}: {value}")
return "200"
mefiz.com