286 {
287 FL_WARN(
"APPROACH 4: JSON Response with await pattern");
288
289
290
292
293
294
296
298
300
301 FL_WARN(
"SUCCESS [JSON Await] HTTP fetch successful! Status: "
303
304
306 FL_WARN(
"DETECTED [JSON Await] Response contains JSON data");
307
308
310
311
312
315
316 FL_WARN(
"JSON [Await] Request Origin IP: " << origin_ip);
317 FL_WARN(
"JSON [Await] Request URL: " << request_url);
318
319
324
325 FL_WARN(
"JSON [Await] User-Agent: " << user_agent);
326 FL_WARN(
"JSON [Await] Accept: " << accept);
327 }
328
329
332 if (
args.size() > 0) {
333 FL_WARN(
"JSON [Await] Query parameters found: " <<
args.size());
334 } else {
335 FL_WARN(
"JSON [Await] No query parameters in request");
336 }
337 }
338
339
341
342 } else {
343 FL_WARN(
"INFO [JSON Await] Response is not JSON format");
344
346 }
347
348 } else {
349
350 FL_WARN(
"ERROR [JSON Await] Request failed: " <<
result.error_message());
351
353 }
354
356}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Response & json(const class json &data)
Set JSON response body with automatic Content-Type header.
Response & status(int code)
Set HTTP status code.
bool contains(size_t idx) const FL_NOEXCEPT
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.
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NOEXCEPT
Fill a range of LEDs with a solid color.
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)
asio::http::Response http_response
Representation of an 8-bit RGB pixel (Red, Green, Blue)