203 {
205 Serial.println(
"\nHTTP Client Validation Suite (Loopback Mode)");
206 Serial.println(
"Starting self-contained server + client test\n");
207
210
211
212
213
215
216 const char* json_response = R"({
217 "slideshow": {
218 "author": "FastLED Community",
219 "title": "FastLED Tutorial",
220 "slides": [
221 {"title": "Introduction to FastLED", "type": "tutorial"},
222 {"title": "LED Basics", "type": "lesson"},
223 {"title": "HTTP Fetch API", "type": "demo"}
224 ]
225 }
226})";
229 .header("Content-Type", "application/json")
230 .body(json_response);
232 });
233
234
236 const char* json_response = R"({
237 "origin": "127.0.0.1",
238 "url": "http://localhost:8081/get"
239})";
242 .header("Content-Type", "application/json")
243 .body(json_response);
245 });
246
247
250 });
251
252
254 Serial.print(
"Server started on http://localhost:");
257 } else {
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
static Response ok(const string &body="")
Factory method for 200 OK response.
asio::http::Request http_request
asio::http::Response http_response