Request/Response Handling in Python
From the Flask cheat sheet · Request & Response · verified Jul 2026
Request/Response Handling
Work with request and response objects
python
# Quick Reference
from flask import request, jsonify, make_response
# Get request data
data = request.get_json()
param = request.args.get('param')
file = request.files['file']
# Send responses
return jsonify({'key': 'value'})
return make_response('Custom', 201)💡 jsonify() automatically sets Content-Type to application/json
🔍 request.get_json() parses JSON request body
⚡ make_response() gives full control over response
requestresponse