That part is fine, I can send the status header.
The problem is the body of the response, i.e. the JSON portion of the message.
I'm using libfcgi, so I want to do something like this:
FCGX_PutS("Content-type: application/json\r\n"
"Status: 400 Bad Request\r\n"
"\r\n"
"{\"message\":\"Body should be a JSON Hash\"}\n",
request->out);
Ideally the client would receive the error response (this part is working) and the response JSON. Currently the response JSON isn't reaching the client, instead I get the Hiawatha 400 page (HTML + some style information).
Thanks for the quick response,
--
Mike