MCPcopy Create free account
hub / github.com/Stiffstream/restinio / handler

Function handler

dev/sample/custom_buffer/main.cpp:42–58  ·  view source on GitHub ↗

Create request handler.

Source from the content-addressed store, hash-verified

40
41// Create request handler.
42restinio::request_handling_status_t handler( const restinio::request_handle_t& req )
43{
44 if( restinio::http_method_get() == req->header().method() &&
45 req->header().request_target() == "/" )
46 {
47 req->create_response()
48 .append_header( restinio::http_field::server, "RESTinio hello world server" )
49 .append_header_date_field()
50 .append_header( restinio::http_field::content_type, "text/plain; charset=utf-8" )
51 .set_body( make_resp_body() )
52 .done();
53
54 return restinio::request_accepted();
55 }
56
57 return restinio::request_rejected();
58}
59
60int main()
61{

Callers

nothing calls this directly

Calls 7

make_resp_bodyFunction · 0.85
request_acceptedFunction · 0.85
request_rejectedFunction · 0.85
methodMethod · 0.80
request_targetMethod · 0.80
create_responseMethod · 0.80
doneMethod · 0.45

Tested by

no test coverage detected