Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/HTTPS-Authenticated/C/https-authenticated.c
Normal file
22
Task/HTTPS-Authenticated/C/https-authenticated.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://user:password@secure.example.com/");
|
||||
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