A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
22
Task/HTTPS/C/https.c
Normal file
22
Task/HTTPS/C/https.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
char buffer[CURL_ERROR_SIZE];
|
||||
|
||||
if ((curl = curl_easy_init()) != NULL) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://sourceforge.net/");
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
|
||||
if (curl_easy_perform(curl) != CURLE_OK) {
|
||||
fprintf(stderr, "%s\n", buffer);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue