veridic

prepare, build and run

  sudo make install
  
  make
  
  ./bin/bin

basic struct request

 Veridic Url("https://URL");
 
  string data = url.get();
  
  cout << data;
 

curl-http-wrapper

make http requests easily in c++ using libcurl, contains two modules, raw http and Veridic that wraps the raw giving it even more functions, I recommend using Veridic but if you want you can use raw http but it has certain limitations, such as only making one request per instance which does not happen in Veridic

modules

  • HTTP RAW (wrap curl)
  • VERIDIC (wrap HTTP RAW)

examples

in main or function etc

POST

  Veridic tasty("https://API_name");
  
  POST fields = {
    "name: jhon",
    "lastname: doe"
  }
  
  Headers headers = {
    "data: test",
    "example: true"
  };
    
  tasty.post(fields, headers, "/user");
  tasty.post(fields, "/users");
  tasy.post(fields);
  

GET

get_dos

Methods

  • POST
  • GET
  • PUT
  • DELETE
  • CUSTM

example get

example put

example delete

example custom

functions and arguments

 constructor:
 
   Veridic();
   Veridic(URL);
 
 void setURL(URL);
 
 

 [VERIDIC]
 
 int post(FIELDS,  HEADERS,  OPTIONAL endpoint,  OPTIONAL type); 
 int post(FIELDS, OPTIONAL endpoint,  OPTIONAL type);
 
 int get(string optional_endpoint);
 int get(GET& fields, string optional_endoint);

optional values are the endpoint of the URL, and the request type, GET and POST are separate, but PUT and DELETE are variations of the POST type

  int put(FIELDS, HEADERS, OPTIONAL endpoint);
  int put(FIELDS, OPTIONAL endpoint);
  
  
  int Delete(FIELDS, HEADERS, OPTIONAL endpoint);
  int Delete(FIELDS, OPTIONAL endpoint);


FIELDS

the fields are a structure in charge of controlling and preparing the necessary parameters for the requests, they have no limit

Examples

 Headers = {
   "data: 1",
   "data: 2",
   "data: N"
 };

   POST fields = {
     "uno=1",
     "dos=2",
     "tres=3",
     "N=N"
   };
   
   GET fields = {
     "uno=1",
     "dos=2",
     "tres=3",
     "N=N"
   };
   
   PUT fields = {
     "uno=1",
     "dos=2",
     "tres=3",
     "N=N"
   };
   
   DELETE fields = {
     "uno=1",
     "dos=2",
     "tres=3",
     "N=N"
   };
 

GitHub

View Github