Project

General

Profile

Json body of http-request

Added by Alexey Kapustin over 8 years ago

Hello, 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 out 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.


Replies (1)

RE: Json body of http-request - Added by Wim Dumon over 8 years ago

Hello,

The contents from the request can be read in the 'request' parameter. request.in() is what you're looking for.

For writing, you'll write to response.out().

Wim.

    (1-1/1)