0Pricing
Flask Academy · Lesson

Content-Type and the Accept Header

Why JSON responses advertise application/json.

Headers Carry Meaning

A response is more than a body. HTTP headers describe that body, and two of them decide how JSON flows between client and server. 📨

What Content-Type Says

The Content-Type header announces the format of the body you are sending. For JSON replies its value is application/json.

Content-Type: application/json

All lessons in this course

  1. jsonify a Dictionary
  2. Return Lists and Nested Data
  3. Set Status Codes on JSON Replies
  4. Content-Type and the Accept Header
← Back to Flask Academy