MCPcopy Create free account
hub / github.com/FastLED/FastLED / is_json

Method is_json

src/fl/net/http/fetch.h:122–130  ·  view source on GitHub ↗

Check if response appears to contain JSON content @return true if Content-Type header indicates JSON or body contains JSON markers

Source from the content-addressed store, hash-verified

120 /// Check if response appears to contain JSON content
121 /// @return true if Content-Type header indicates JSON or body contains JSON markers
122 bool is_json() const {
123 auto content_type = get_content_type();
124 if (content_type.has_value()) {
125 fl::string ct = *content_type;
126 // Check for various JSON content types (case-insensitive)
127 return ct.find("json") != fl::string::npos;
128 }
129 return false;
130 }
131
132 /// Set methods (internal use)
133 void set_status(int status_code) { mStatusCode = status_code; }

Callers 5

mainFunction · 0.80
test_json_endpointFunction · 0.80
test_get_endpointFunction · 0.80
test_json_responseFunction · 0.80
test_json_awaitFunction · 0.80

Calls 2

has_valueMethod · 0.45
findMethod · 0.45

Tested by 4

test_json_endpointFunction · 0.64
test_get_endpointFunction · 0.64
test_json_responseFunction · 0.64
test_json_awaitFunction · 0.64