FastLED 3.9.15
Loading...
Searching...
No Matches

◆ parse_json_body()

fl::json fl::net::http::Response::parse_json_body ( ) const
inlineprivate

Parse JSON from response body with error handling.

Definition at line 152 of file fetch.h.

152 {
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 }
bool is_null() const FL_NOEXCEPT
Definition json.h:238
static json parse(const fl::string &txt) FL_NOEXCEPT
Definition json.h:677

References fl::json::is_null(), mBody, and fl::json::parse().

Referenced by json().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: