Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

http c++ library?

Hi I am wondreing if there is some kind of C++ library that deals with HTTP, HTTPs, chunking etc. Google did not find anything.

like image 480
Roar Avatar asked Jan 21 '23 19:01

Roar


2 Answers

Maybe libCURL?

like image 156
5ound Avatar answered Jan 29 '23 09:01

5ound


I'm also using libCURL in my projects. It has bindings with many programming languages. (libcurl Bindings)
But using it without them is also very easy. Simplest example:

#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
  CURL *curl;
  CURLcode res;

  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
    res = curl_easy_perform(curl);

    /* always cleanup */ 
    curl_easy_cleanup(curl);
  }
  return 0;
}

This example and many more can be found here.

like image 35
virious Avatar answered Jan 29 '23 11:01

virious