@@ -8,17 +8,17 @@ void TimersResponder::reply(std::ostream& out, cxxtools::http::Request& request,
8
8
showTimers (out, request, reply);
9
9
} else if ( request.method () == " DELETE" ) {
10
10
deleteTimer (out, request, reply);
11
- } else if ( request.method () == " POST" ) {
11
+ } else if ( request.method () == " POST" || request. method () == " PUT " ) {
12
12
createTimer (out, request, reply);
13
13
} else {
14
- reply.httpReturn (501 , " Only GET, DELETE and POST methods are supported." );
14
+ reply.httpReturn (501 , " Only GET, DELETE, POST and PUT methods are supported." );
15
15
}
16
16
}
17
17
18
18
void TimersResponder::createTimer (std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply)
19
19
{
20
- esyslog (" restulfapi : /%s/" , request.bodyStr ().c_str ());
21
-
20
+ esyslog (" restfulapi : /%s/" , ( const char *) request.bodyStr ().c_str ());
21
+ /*
22
22
cxxtools::QueryParams q;
23
23
if ( request.method() != "POST" && request.method() != "PUT" ) {
24
24
reply.httpReturn(501, "ONly POST and PUT methods are supported.");
@@ -88,7 +88,7 @@ void TimersResponder::createTimer(std::ostream& out, cxxtools::http::Request& re
88
88
esyslog("restfulapi: successfully added timer");
89
89
}
90
90
}
91
- }
91
+ }*/
92
92
}
93
93
94
94
void TimersResponder::deleteTimer (std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply)
0 commit comments