MCPcopy
hub / github.com/keploy/keploy / IsJSON

Function IsJSON

pkg/util.go:3603–3606  ·  view source on GitHub ↗
(body []byte)

Source from the content-addressed store, hash-verified

3601}
3602
3603func IsJSON(body []byte) bool {
3604 var js interface{}
3605 return json.Unmarshal(body, &js) == nil
3606}
3607
3608func IsXML(data []byte) bool {
3609 var xm xml.Name

Callers 7

matchMethod · 0.92
ExactBodyMatchMethod · 0.92
DiffMethod · 0.92
redactBodyFunction · 0.92
GuessContentTypeFunction · 0.85

Calls 1

UnmarshalMethod · 0.80

Tested by

no test coverage detected