GET application/json

Each. request for a resource has a similar pattern. Request the HTML, load and execute the javascript that in turn make an authenticated request for the JSON (assume for now you are authenticated)

Summary

GET / (text/html)
GET api.js (text/javascript)
GET / (application/json;q=1.0 & XMLHttpRequest) (with Authorization header)

api requests

Setting the Accept Header

The api client uses (Axios) to make HTTP requests the hood. In the example above, the highlighted lines are the headers that must be set by the client to request JSON over HTML.

Unlock the next chapter
Making a request for application/json probably requires
Adding to the Accept header
Adding a Authorization header with JWT
Ensuring application/json has a high q value
All of the above