我想用 C++ 发送和接收 POST 数据,我尝试使用 Curl,但它有很多依赖项,这对我的项目不利。如果有人可以帮助我提供代码,那将是完美的,谢谢
一种选择是使用卡萨布兰卡
部分代码示例:
http_client client(YourUrl);
http_response httpResponse = client.request(methods::POST, L"/upload", Yourjson).get();
if (httpResponse.status_code() != status_codes::OK)
{
ok = false;
}
以后请发布您尝试过的方法,具体失败的原因并添加代码示例。