109 {
110 FL_WARN(
"APPROACH 1: Promise-based pattern with explicit types");
111
112
113
114
115
116
118
120 FL_WARN(
"SUCCESS [Promise] HTTP fetch successful! Status: "
122
123
124
127 FL_WARN(
"CONTENT [Promise] Content-Type: " << *content_type);
128 }
129
130
132 if (response_body.
length() >= 100) {
133 FL_WARN(
"RESPONSE [Promise] First 100 characters: " << response_body.
substr(0, 100));
134 } else {
135 FL_WARN(
"RESPONSE [Promise] Full response (" << response_body.
length()
136 << " chars): " << response_body);
137 }
138
139
141 } else {
142
143 FL_WARN(
"ERROR [Promise] HTTP Error! Status: "
146
147
149 }
150 })
151
152
154
155 FL_WARN(
"ERROR [Promise] Network Error: " << network_error.
message);
156
157
159 });
160}
bool has_value() const FL_NOEXCEPT
fl::size length() const FL_NOEXCEPT
HTTP response class (unified interface)
string substr(fl::size start, fl::size length) const FL_NOEXCEPT
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.
Representation of an 8-bit RGB pixel (Red, Green, Blue)