Hello everyone, In this post, you will learn, How to get headers param value in Python Flask framework. The example program has been tested and shared in the same post.
Example Program
from flask import Flask, request app = Flask(__name__) @app.route('/hello') def hello(): name = request.headers.get('name') return 'Hello '+name app.run()
Output
* Serving Flask app "app" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

More from my site

Hello, folks, I am a founder of idineshkrishnan.com. I love open source technologies, If you find my tutorials are useful, please consider making donations to these charities.
No responses yet