── JSON helpers ── IsJSONContentType reports whether the Content-Type header indicates a JSON response.
(ct string)
| 188 | |
| 189 | // IsJSONContentType reports whether the Content-Type header indicates a JSON response. |
| 190 | func IsJSONContentType(ct string) bool { |
| 191 | return strings.Contains(ct, "application/json") || strings.Contains(ct, "text/json") |
| 192 | } |
| 193 | |
| 194 | // ParseJSONResponse decodes a raw SDK response body as JSON. |
| 195 | // CallAPI and HandleResponse both delegate to this function. |