Skip to content

Simple HTTP request lib backed by libcurl, inspired by superagent.

Notifications You must be signed in to change notification settings

littlstar/request.cc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

request.cc

Simple HTTP request lib backed by libcurl, inspired by superagent.

Example

#include <assert.h>
#include <iostream>
#include "request.h"

int
main(){
  littlstar::Request *req = new littlstar::Request;
  littlstar::Response *res = NULL;

  req->Get("https://littlstar.com/api/v1/videos");
  req->Query("foo", "bar");
  req->Set("X-ApiKey", "myapikey");
  req->Accept("application/json");

  res = req->End();

  assert(res->ok);
  std::cout << res->data << std::endl;

  delete req;
  delete res;

  return 0;
}

License

MIT

About

Simple HTTP request lib backed by libcurl, inspired by superagent.

Resources

Stars

Watchers

Forks

Packages

No packages published