I am looking for a way to use and create simple HTTP PUT requests in C++11 in the form of x-www-form-urlencoded
my project is built without CMake however, so I cannot use libraries such as cpr. I have looked into curl
and libcurl
but they seem far too complicated and hard to implement in Windows, and in Visual Studio 2019.
I have also viewed previously asked questions such as this but it's over 10 years old and I was hoping better and more efficient methods would be available.
My friend recommends using Boost.Asio however, again it seems overly complicated.
edit: I can use libraries, just not ones that require CMake. As my project is built without CMake and creating it again would be tedious and would take a long time.
edit2: I managed to solve my issue using this library. This library seemed to be the easiest to use as well as clearest, in my opinion.
How I created a PUT request:
http::Request request("URL");
http::Response response;
// pass parameters as a map
std::map<std::string, std::string> parameters = {
{"hunger", }, {"xp", 22"}, {"poop", "22"}, {"mood", "happy"} };
response = request.send("PUT", parameters, {
"Content-Type: application/x-www-form-urlencoded"
});