When calling GET https://api.spotify.com/v1/me/player and the account doesn't have any device active/open, the endpoint returns a 204. However, this isn't documented here. It only lists a 200 status code.
It would be nice to have this possible status code included in the docs.
Btw.: even the web-console doesn't handle this status correctly. It tries to parse the 204 as JSON and no response is shown - only an error in the DevTools console.