I am coding a GCO plugin to throw poof-of-concept (see this for more context) that would use the HTTP 1.1 protocol to interact with my Bismon system (code GPLv3 + on github, but not published; technical report here) (which provides Web and HTTP services using
libonion). The server and the client are on the same trusted local network (so HTTP and HTTPS insecurity issues are out of scope).
In my limited understanding, my GCC plugin would be a RESTful client (however, I still do not understand what that means exactly). Morally, this plugin does a kind of RPC (or even JSONRPC) using HTTP transport.
This plugin will use libcurl's easy interface and will make a POST request, inspired by this example.
For good internal reasons, I would prefer that the data sent in this application (from plug-in to
Bismon) to be JSON encoded data and I will use the json-cpp library in this plugin.
It is obviously easier for me to send, as CURLOPT_POSTFIELDS, the whole JSON object by avoiding to code it a second time.
application / x-www-form-urlencoded MIME type.
Is it reasonable to do so, just send a
application / json data in the
TO POST request?
Most of the examples I see use
application / x-www-form-urlencoded
PS Bismon already has the code to handle HTTP POST requests with the help of libonion, and I'd like to reuse the same code (for HTTP requests from my GCC plugin via
libcurl, not a real browser like Firefox)