Skip to content

Commit

Permalink
Rollback v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
D7EAD authored Nov 25, 2021
1 parent f018e8f commit 5ac9eb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/include/gecko.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ namespace gecko {
// Notes: should be checked before using any API functions
DllExport bool ping(); // just one function for 'ping', might as well put it in api.
};
}
}
24 changes: 7 additions & 17 deletions src/include/web.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <map>
#include <memory>
#include <cpr/cpr.h>
#include <nlohmann/json.hpp>

// reminds you of MS' __in and __in_opt, huh? ;)
#define OPTIONAL
Expand All @@ -17,25 +16,16 @@ namespace gecko {
// Purpose: class interface used internally(privately) by *functions class methods to send requests to the CoinGecko endpoint.
class web {
public:
// class that is returned to the user by *functions class methods so they don't have to deal with the whole CPR object -- unless they want
class response {
public:
response(
std::string _text,
std::string _response_code,
std::string _url,
cpr::Response _cURL_Object
) : text(_text), response_code(_response_code), url(_url), cURL_Object(_cURL_Object), json(nlohmann::json::parse(_text)) {}

std::string text;
std::string response_code;
std::string url;
cpr::Response cURL_Object;
nlohmann::json json;
// struct that is returned to the user by *functions class methods so they don't have to deal with the whole CPR object -- unless they want
typedef struct response {
std::string text;
std::string response_code;
std::string url;
cpr::Response cURL_Object;
};

// function for sending GET request to API at 'this->endpoint+endpointPath' with optional parameters.
cpr::Response request (
cpr::Response request(
REQUIRED std::string endpointPath,
OPTIONAL cpr::Parameters* parameters
);
Expand Down

0 comments on commit 5ac9eb1

Please sign in to comment.