3 ms·
The `Accept` HTTP header is there to prove your frontend is using "dumb" data. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept https://develope
by MattyRad 3y ago
The `Accept` HTTP header is there to prove your frontend is using "dumb" data. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ac...
I think the author is generally correct that all data should be provided in a single request. And to take it a step further, you should be able to change your accept header to JSON to serve an API. API/dumb-frontend aren't mutually exclusive.
In fact, this is what both GitLab and GitHub do. Try it out!
`curl -L https://github.com/simonw/shot-scraper https://github.com/simonw/shot-scraper` (defaults to text/html)
`curl --header "Accept: application/json" -L https://github.com/simonw/shot-scraper https://github.com/simonw/shot-scraper`