2016-03-08 340 views

回答

3

你想去做this example from their documentation

auto r = cpr::Post(cpr::Url{"http://www.httpbin.org/post"}, 
        cpr::Body{"This is raw POST data"}, 
        cpr::Header{{"Content-Type", "text/plain"}}); 

而不是使用cpr::Payload的,使用cpr::Body和JSON對象的dump() method