tags:

views:

64

answers:

1

I'm just learning to code in C, and I wan't to know if anyone can point me in the right direction, or give me an example for a simple HTTP Get request in C.

Thanks :)

+4  A: 

You may checkout libcurl. And here are some examples. It could be as easy as (taken from the doc):

#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;
}
Darin Dimitrov