You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, a 403 response (unauthorized) returns an HTML page, but go-rest attempts to decode the body as JSON, and returns a cryptic error such as "invalid character '<' looking for beginning of value" instead of a Response object with the status code.
For example, a 403 response (unauthorized) returns an HTML page, but go-rest attempts to decode the body as JSON, and returns a cryptic error such as "invalid character '<' looking for beginning of value" instead of a Response object with the status code.
See https://github.com/Workiva/go-rest/blob/master/rest/client.go#L100 for how a 404 is correctly handled.
Are there any cases where we want to attempt to decode a JSON response if we have a status other than 200 (or 20x)?
The text was updated successfully, but these errors were encountered: