Response body parsed as JSON (JavaScript-like API)
- Returns
- fl::Json object for safe, ergonomic access
- Note
- Automatically parses JSON on first call, caches result
-
Returns null JSON object for non-JSON or malformed content
Definition at line 319 of file fetch.cpp.
319 {
323 } else {
326 }
328 }
329
331}
fl::Json parse_json_body() const
Parse JSON from response body with error handling.
fl::optional< fl::Json > mCachedJson
bool is_json() const
Check if response appears to contain JSON content.
static const fl::size npos
References FL_WARN, is_json(), mBody, mCachedJson, mJsonParsed, fl::string::npos, and parse_json_body().
Referenced by test_json_await(), and test_json_response().