Cannot trigger THttpServer to execue command using wget/curl

ROOT Version: 6.18
Platform: Linux x86
Compiler: GCC

I was playing with the THttpServer example. And made some modifications.

root [0] auto serv = new THttpServer("http:");
Info in <THttpEngine::Create>: Starting HTTP server on port
root [1] do_stuff = [](){cout << "Hello World" << endl;};
root [2] serv->RegisterCommand("/ping", "do_stuff()");

But I can’t trigger ROOT to execute the command via the command line. wget gets me a 404.

$ wget http://localhost:8999/ping
--2019-09-09 16:48:36--  http://localhost:8999/ping
Resolving localhost (localhost)... ::1,
Connecting to localhost (localhost)|::1|:8999... failed: Connection refused.
Connecting to localhost (localhost)||:8999... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-09-09 16:48:36 ERROR 404: Not Found.

Why? Am I doign anything wrong?

Ahh… my fault. I found the problem right after I post my problem. The correct path should be wget h ttp://localhost:8999/ping /cmd.json

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.