Skip to content

Instantly share code, notes, and snippets.

@lettergram
Created May 25, 2016 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lettergram/8a6a54d5324928a668f7915edbf4a812 to your computer and use it in GitHub Desktop.
Save lettergram/8a6a54d5324928a668f7915edbf4a812 to your computer and use it in GitHub Desktop.
#ifndef CAPI_H
#define CAPI_H
#include <iostream>
#include <string>
#include <stdio.h>
#include <curl/curl.h>
class capi {
public:
capi(std::string base_url);
~capi();
/* REST API Calls */
std::string get(std::string end_point);
std::string post(std::string end_point);
std::string patch(std::string end_point, std::string data);
/* Get/Set */
void set_base_url(std::string base_url);
std::string get_base_url();
void set_auth_token(std::string token);
std::string get_auth_token();
void set_obj_id(std::string id);
std::string get_obj_id();
private:
std::string root_url;
std::string auth_token;
std::string obj_id;
};
#endif // CAPI_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment