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

◆ parse_json_body()

fl::Json fl::response::parse_json_body ( ) const
inlineprivate

Parse JSON from response body with error handling.

Definition at line 157 of file fetch.h.

157 {
158 fl::Json parsed = fl::Json::parse(mBody);
159 if (parsed.is_null() && (!mBody.empty())) {
160 // If parsing failed but we have content, return null JSON
161 // This allows safe chaining: resp.json()["key"] | default
162 return fl::Json(nullptr);
163 }
164 return parsed;
165 }
bool is_null() const
Definition json.h:1730
static Json parse(const fl::string &txt)
Definition json.h:2126
fl::string mBody
Definition fetch.h:149

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: