1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-12-01 05:42:02 +00:00
AIO-switch-updater/include/download.hpp
2021-09-11 15:48:13 +02:00

18 lines
No EOL
878 B
C++

#pragma once
constexpr int ON = 1;
constexpr int OFF = 0;
#include <json.hpp>
namespace download {
long downloadFile(const std::string& url, std::vector<std::uint8_t>& res, const char* output = "", int api = OFF);
long downloadFile(const std::string& url, const char* output = "", int api = OFF);
std::vector<std::pair<std::string, std::string>> getLinks(const std::string& url);
std::vector<std::pair<std::string, std::string>> getLinksFromJson(const nlohmann::ordered_json& json_object);
std::string fetchTitle(const std::string& url);
long downloadPage(const std::string& url, std::string& res, const std::vector<std::string>& headers = {}, const std::string& body = "");
long getRequest(const std::string& url, nlohmann::ordered_json& res, const std::vector<std::string>& headers = {}, const std::string& body = "");
} // namespace download