1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
url = "https://sessionserver.mojang.com/session/minecraft/hasJoined?username="); url.append(player.Username); // <-- NOTE: see further below! url.append("&serverId="); url.append(player.loginHash); // <-- NOTE: see further below! std::cout << url << std::endl; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L); curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L); curl_easy_setopt(curl, CURLOPT_CAINFO, "cacert.pem"); curl_easy_setopt(curl, CURLOPT_USERAGENT, "MinecraftServerPP"); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &_write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); |
https://stackoverflow.com/questions/37997328/using-curl-for-get-request
Вот, это "основа" get-запроса к одному из тестовых url...а на mail.ru, нужно еще дописывать все это дело.