Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/HTTPS/C/https.c
Normal file
18
Task/HTTPS/C/https.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <curl/curl.h>
|
||||
CURL *curl;
|
||||
char buffer[CURL_ERROR_SIZE];
|
||||
int main(void) {
|
||||
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