Skip to content

Instantly share code, notes, and snippets.

@pushmon
Created April 2, 2014 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pushmon/9935515 to your computer and use it in GitHub Desktop.
Save pushmon/9935515 to your computer and use it in GitHub Desktop.
C Language
<#if filename>
c_.txt
<#elseif title>
C
<#elseif logo>
//dmnv44fd3imdv.cloudfront.net/www.pushmon.com/img/code/java.gif
<#elseif code>
#include <stdio.h>
#include <curl.h>
int main(int agrc, char **argv) {
CURL *curl;
CURLcode res;
char *url = "${urlstring}";
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
if (res == CURLE_OK) {
printf("OK");
}
else {
printf("Error: %s", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
}
return 0;
}
</#if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment