djkah11 djkah11 - 14 days ago 4x
JSON Question

Get json from Wt::Http::Request& request

I have problem with json request :(
I have class

class ForumCreate : public Wt::WResource

and function

virtual void handleRequest(const Wt::Http::Request& request, Wt::Http::Response& response)

request.contentType() is application/json.
How do I get json from request?(

Maybe I should use something else to get json?
Task: User send http-request with json on static url. I need to analize json file and send json-response.


You're going to need to parse the data from the input stream provided by

std::istream & Wt::Http::Request::in    (       )   const

It should be the raw json text.