I am using cpprestsdk in order to create http client. I need to convert web::json::value
like this:
web::json::value obj;
obj[U("1")] = web::json::value(U("123"));
obj[U("2")] = web::json::value(U("321"));
to std::vector<unsigned char>
In order to put it to request
web::http::http_request req(method);
req.set_body(data); <<-- data == std::vector<unsigned char>
and send to the server. I know how to send web::json::value
and utility::string_t
but have the problem with vector of bytes. So my question is how to convert web::json::value
to std::vector<unsigned char>
. Thanks.