Git Product home page Git Product logo

cppurl's Introduction

Rest client library, using libcurl

A small framework for simple client-side REST API requests for C++. It uses libcurl. It got its name from a play on the words curl and cpp.

Features

  • Object oriented
  • Adjustable headers
  • Configurable user agent
  • Adjustable timeout
  • Native C++ containers: map, string
  • QA object
  • Curl and HTTP code status
  • It is possible to turn off certificate validation
  • A configurable version of the HTTP protocol

Installation

Just download the latest release and unzip it into your project. You can turn it on with:

#include "cppurl/lib/cppurl.hpp"
using namespace marcelb;

Usage

// init, and sets
Curl rest;
string header_value = "3849f438uf9uedu8ejweoijwejd09230";
rest.header("API", header_value).timeout(700)
    .httpv(HTTP2).sslverifyoff();
// execute and print
cout << rest.get("https://reqres.in/api/users/2") << endl << 
    "Curl status " << rest.curlStatus << endl << 
    "HTTP status " << rest.httpStatus << endl;

for (auto header : rest.responseHeader) {
    cout << header.first << " " << header.second << endl;
}

License

APACHE 2.0

Support & Feedback

For support and any feedback, contact the address: [email protected].

Contributing

Contributions are always welcome!

Feel free to fork and start working with or without a later pull request. Or contact for suggest and request an option.

cppurl's People

Contributors

mxmarcelb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.