If the server response is 200 OK then everything is OK, but what if it is 401 INVALID or any other invalid message? How will I know? The API call is part of a YAML config like this:
That’s not a good reply. The status code is not returned in a JSON attribute. That’s why I’m asking.
401 errors returns an HTML response while i.e. a 406 returns a JSON response. There’s no way to know that in advance except by analysing the status code.
So how can I fetch the status code?