Definition at line 74 of file ClientValidationReal.h.
74 {
75 FL_WARN(
"\n=== Test 1: GET /json (Slideshow Data) ===");
76
79
84 return;
85 }
86
88 if (resp.
status() != 200) {
92 return;
93 }
94
96 FL_WARN(
"✗ FAILED: Response is not JSON");
99 return;
100 }
101
105 int slide_count = data[
"slideshow"][
"slides"].
size();
106
107 if (author ==
"unknown" ||
title ==
"untitled" || slide_count == 0) {
108 FL_WARN(
"✗ FAILED: Invalid JSON structure");
109 FL_WARN(
" Author: " << author);
111 FL_WARN(
" Slides: " << slide_count);
114 return;
115 }
116
118 FL_WARN(
" Author: " << author);
120 FL_WARN(
" Slides: " << slide_count);
122}
fl::UITitle title("Animartrix")
size_t size() const FL_NOEXCEPT
bool is_json() const
Check if response appears to contain JSON content.
const fl::string & status_text() const
HTTP status text (like JavaScript response.statusText)
int status() const
HTTP status code (like JavaScript response.status)
fl::json json() const
Response body parsed as JSON (JavaScript-like API)
HTTP response class (unified interface)
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Result type for promise operations.
fl::task::Promise< Response > fetch_get(const fl::string &url, const FetchOptions &request)
HTTP GET request.
PromiseResult< T > await_top_level(Promise< T > p)
Synchronously wait for a promise to complete (ONLY safe in top-level contexts)
expected< T, E > result
Alias for expected (Rust-style naming)
References fl::task::await_top_level(), FAILED, fl::net::http::fetch_get(), FL_WARN, fl::net::http::Response::is_json(), fl::net::http::Response::json(), fl::json::size(), state, fl::net::http::Response::status(), fl::net::http::Response::status_text(), tests_failed, tests_passed, and title.
Referenced by loop().