HTTPS: Difference between revisions

104 bytes removed ,  3 years ago
Fixed whitespace and replaced declarations.
(Fixed import so is more general.)
(Fixed whitespace and replaced declarations.)
Line 63:
=={{header|C}}==
{{libheader|libcurl}}
<lang c>#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
CURL *curl;
 
char buffer[CURL_ERROR_SIZE];
int
int main(void) {
if ((curl = curl_easy_init()) != NULL) {
{
curl_easy_setopt(curl, CURLOPT_URL, "https://sourceforge.net/");
CURL *curl;
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
char buffer[CURL_ERROR_SIZE];
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, buffer);
 
if (curl_easy_perform(curl = curl_easy_init()) != NULLCURLE_OK) {
curl_easy_setoptfprintf(curlstderr, CURLOPT_URL"%s\n", "https://sourceforge.net/"buffer);
return EXIT_FAILURE;
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_SUCCESScurl_easy_cleanup(curl);
}
}
return EXIT_SUCCESS;
}</lang>
 
=={{header|C sharp|C#}}==