Headers, Cookies, and the Client IP
Access request.headers, cookies, and remote_addr.
Requests Carry Metadata
Beyond the body, every request ships metadata like headers, cookies, and the client address that your views can inspect.
Read Headers With request.headers
The request.headers object is a case-insensitive mapping of all HTTP headers the client sent along with the call.
agent = request.headers["User-Agent"]All lessons in this course
- Query Strings via request.args
- Form Fields via request.form
- JSON Bodies via request.get_json
- Headers, Cookies, and the Client IP