I have a C++ API, I want to send commands through http to run any c++ method from this API. I'm using libmicrohttpd.
What steps should I follow to do such a work?
You would write your code to listen for specific requests from your HTTP server. When one of those requests comes in you process it to get the data you need (passed as GET or POST parameters most likely) and then make the appropriate call against the C++ library that you have. You handle the return value (if there is any) to create a response that you send back to the user. Making the request
Handling the response
For specifics related to libmicrohttpd have you looked at the tutorial? Chapter 3 (Exploring Requests) and 6 (Processing POST Data) seem applicable to what you are doing. |
|||
|
eval
function. Many libraries do not provide this, for obvious security reasons. You'll have to put something on the server that performs this eval function for you. – Robert Harvey Mar 21 at 16:00