MCPcopy Create free account
hub / github.com/SmingHub/Sming / onHello

Function onHello

samples/HttpServer_Bootstrap/app/application.cpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void onHello(HttpRequest& request, HttpResponse& response)
32{
33 response.setContentType(MIME_HTML);
34
35 // Below is an example how to send multiple cookies
36 response.setCookie("cookie1", "value1");
37 response.setCookie("cookie2", "value", true);
38
39 // Use direct strings output only for small amount of data (huge memory allocation)
40 response.sendString("Sming. Let's do smart things.");
41}
42
43void onFile(HttpRequest& request, HttpResponse& response)
44{

Callers

nothing calls this directly

Calls 3

setContentTypeMethod · 0.80
setCookieMethod · 0.80
sendStringMethod · 0.45

Tested by

no test coverage detected