我想出了这段代码,但不确定它是否正确使用:
boost::system::error_code ec;
nghttp2::asio_http2::header_map headers;
headers.insert(std::pair<std::string, nghttp2::asio_http2::header_value>("content-type", {"application/json; charset=utf-8", false}));
headers.insert(std::pair<std::string, nghttp2::asio_http2::header_value>("content-length",{std::to_string(r.length()), false}));
auto req = session->submit(ec, "POST", uri, r.data(), headers);
谁能告诉我这是否正确使用。
谢谢