Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <curl/curl.h>
- #define SIZE_OF_BUFF 100
- //int main(void){
- int main(int argc, char *argv[]){
- CURL *curl;
- CURLcode res;
- if(argc < 2) {
- printf("Usage: %s <URL>\n", argv[0]);
- return 1;
- }
- curl = curl_easy_init();
- curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
- //Follow redirect
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
- res = curl_easy_perform(curl);
- /* always cleanup */
- curl_easy_cleanup(curl);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement