|
|
|
@ -211,14 +211,14 @@ bool launchpad::is_authenticated() const {
|
|
|
|
|
std::string launchpad::build_full_url(const std::string& endpoint) const {
|
|
|
|
|
if (endpoint.rfind("http", 0) == 0) {
|
|
|
|
|
return endpoint;
|
|
|
|
|
} else if (endpoint != "") {
|
|
|
|
|
} else if (!endpoint.empty()) {
|
|
|
|
|
return service_root + "/" + api_version + "/" + endpoint;
|
|
|
|
|
}
|
|
|
|
|
std::cerr << "Internal error: endpoint is empty" << std::endl;
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::optional<std::string> launchpad::api_get(const std::string& endpoint, const std::map<std::string, std::string>& params) const {
|
|
|
|
|
std::optional<std::string> launchpad::api_get(const std::string endpoint, const std::map<std::string, std::string> params) const {
|
|
|
|
|
std::string url = build_full_url(endpoint);
|
|
|
|
|
if (url.empty()) {
|
|
|
|
|
if (!params.empty()) {
|
|
|
|
@ -296,10 +296,10 @@ std::optional<std::string> launchpad::api_get(const std::string& endpoint, const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::optional<std::string> launchpad::api_post(
|
|
|
|
|
const std::string& endpoint,
|
|
|
|
|
const std::map<std::string, std::string>& params,
|
|
|
|
|
const std::string endpoint,
|
|
|
|
|
const std::map<std::string, std::string> params,
|
|
|
|
|
bool build_endpoint,
|
|
|
|
|
const std::string& token_secret_override
|
|
|
|
|
const std::string token_secret_override
|
|
|
|
|
) {
|
|
|
|
|
if (endpoint.empty()) {
|
|
|
|
|
if (!params.empty()) {
|
|
|
|
|