Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Response headers

The proper configuration of HTTP response headers is paramount for any API. Even in the context of mock servers, these seemingly minor details significantly influence the stability of communication between the browser (client) and the server, serve as the primary mechanism for CORS (Cross-Origin Resource Sharing) compliance, and ultimately contribute directly to the productivity of API developers

Default response headers

For connection stability

HeaderValue
DateResponse date
Content-LengthCalculated from content body
Connectionkeep-alive
Cache-Controlno-store

For security

HeaderValue
x-content-type-optionsnosniff