If you wish to make arbitrary HTTP(S) requests to websites and APIs, e.g. to update statistics on bot lists, you can use code similar to the code below. You may pass any arbitrary POST data:
#include <dpp/dpp.h>
#include <iostream>
int main() {
std::string mypostdata = "{\"value\": 42}";
bot.request(
std::cout <<
"I got reply: " << cc.
body <<
" with HTTP status code: " << cc.
status <<
"\n";
},
mypostdata,
"application/json",
{
{"Authorization", "Bearer tokengoeshere"}
}
);
});
return 0;
}