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

Method parse_json_body

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

Parse JSON from response body with error handling

Source from the content-addressed store, hash-verified

150
151 /// Parse JSON from response body with error handling
152 fl::json parse_json_body() const {
153 fl::json parsed = fl::json::parse(mBody);
154 if (parsed.is_null() && (!mBody.empty())) {
155 // If parsing failed but we have content, return null JSON
156 // This allows safe chaining: resp.json()["key"] | default
157 return fl::json(nullptr);
158 }
159 return parsed;
160 }
161
162 static fl::string get_default_status_text(int status) { // okay static in header
163 switch (status) {

Callers

nothing calls this directly

Calls 3

jsonClass · 0.50
is_nullMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected