0
我使用cpprestsdk以創建HTTP客戶端。我需要轉換web::json::value
這樣的:cpprestsdk(卡薩布蘭卡)JSON值到std ::矢量<無符號字符>
web::json::value obj;
obj[U("1")] = web::json::value(U("123"));
obj[U("2")] = web::json::value(U("321"));
到std::vector<unsigned char>
爲了把它要求
web::http::http_request req(method);
req.set_body(data); <<-- data == std::vector<unsigned char>
發送到服務器。我知道如何發送web::json::value
和utility::string_t
,但有字節向量的問題。 所以我的問題是,如何web::json::value
轉換爲std::vector<unsigned char>
。謝謝。
聽起來溶液。 – definename