Repository navigation
add header in AsyncWebServerRequest #498
Bernd-git-V
started this conversation in
Support
Replies: 2 comments
|
HI, |
0 replies
|
Hi Mathieu, |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
how can I send a header using the following request:
???Header(“Access-Control-Allow-Origin”, “*”);
server.on("/temperature", HTTP_GET, [](AsyncWebServerRequest *request) {
*server.addMiddleware(setHeaders("Access-Control-Allow-Origin: "));
String json = "{"tempabg":" + String(celsius) + "}";
request->send(200, "application/json", json.c_str());
});
server.addMiddleware(setHeaders("Access-Control-Allow-Origin: *"));
doesn't work.
Who can help me find the mistake?
Thank you very much in advance
Bernd
All reactions