124 {
125 FL_WARN(
"\n=== Test 2: GET /get (Request Echo) ===");
126
129
134 return;
135 }
136
138 if (resp.
status() != 200) {
142 return;
143 }
144
146 FL_WARN(
"✗ FAILED: Response is not JSON");
149 return;
150 }
151
155
156 if (origin == "unknown" || url == "unknown") {
157 FL_WARN(
"✗ FAILED: Invalid response structure");
160 return;
161 }
162
164 FL_WARN(
" Origin: " << origin);
167}
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)