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
351
353 }
354
356}
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
bool contains(size_t idx) const
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
fl::Json json() const
Response body parsed as JSON (JavaScript-like API)
const fl::string & status_text() const
HTTP status text (like JavaScript response.statusText)
int status() const
HTTP status code (like JavaScript response.status)
bool is_json() const
Check if response appears to contain JSON content.
HTTP response class (unified interface)
const T & value() const
Get the success value (const)
bool ok() const
Check if the result is successful.
fl::string error_message() const
Get the error message as a convenience.
Result type for promise operations.
void fill_solid(struct CRGB *targetArray, int numToFill, const struct CRGB &color)
Fill a range of LEDs with a solid color.
fl::result< T > await_top_level(fl::promise< T > promise)
Synchronously wait for a promise to complete (ONLY safe in top-level contexts)
fl::promise< response > fetch_get(const fl::string &url, const fetch_options &request)
HTTP GET request.
Representation of an RGB pixel (Red, Green, Blue)