Chapter 10 project: HTTP 403

Calling the EONET endpoint results in

403 Forbidden https://eonet.gsfc.nasa.gov/api/v2.1/categories

although the same URL works in the browser.

Solved it by adding

@Headers(“Accept: application/json”)

to the Retrofit interface.

1 Like