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/jsonAll lessons in this course
- jsonify a Dictionary
- Return Lists and Nested Data
- Set Status Codes on JSON Replies
- Content-Type and the Accept Header