FastLED 3.10.8
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_NO_EXCEPT
Definition json.h:381
static json parse(const fl::string &txt) FL_NO_EXCEPT
Definition json.h:842

References fl::FL_NO_EXCEPT, 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: