I want to create a Captive Portal for one of my Projects. Normally i use the "standard" ESP8266Webserver.h but in this case i want to use the AsyncWebserver, because of the Async Feature for later purposes..., i read the documentation and try some examples and read the code but i dont understand the following snippet
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{
request->send(200, "text/plain", String(ESP.getFreeHeap()));
});
The Basic structure is no problem...
"server" is my Object, "on" is my Method and "/", HTTP_GET, are "normal" parameters...
But what means: [](AsyncWebServerRequest *request)
{
[...]
});
This is not the "normal" structure?! - There is no closing bracket at the end of parameter head like:
server.on(param,param, param**)**
It is open until behind the last curly bracket... is this a function inline the param?
And what means this: [](AsyncWebServerRequest *request)
Why the [] - is this an Array with multiple Request pointer? and if so why are there only "normal" braces?
I hope someone can explain this code
It is part of this example in line 149...
Thanks for help ^^