MCPcopy
hub / github.com/larksuite/cli / IsJSONContentType

Function IsJSONContentType

internal/client/response.go:190–192  ·  view source on GitHub ↗

── JSON helpers ── IsJSONContentType reports whether the Content-Type header indicates a JSON response.

(ct string)

Source from the content-addressed store, hash-verified

188
189// IsJSONContentType reports whether the Content-Type header indicates a JSON response.
190func 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.

Callers 4

CallAPIMethod · 0.92
TestIsJSONContentTypeFunction · 0.85
HandleResponseFunction · 0.85

Calls 1

ContainsMethod · 0.45

Tested by 2

TestIsJSONContentTypeFunction · 0.68