-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathHttpGet.c
More file actions
24 lines (21 loc) · 710 Bytes
/
HttpGet.c
File metadata and controls
24 lines (21 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "modules/HttpGet.h"
#include <stdio.h>
#include "curl/curl.h"
#include "src/clearCurl.h"
void mainMenuHttpGet(char* domain) {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, domain);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ClearWrite);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_perform(curl);
if(res != CURLE_OK)
printf(" \033[1;91m[-]\033[0;39m %s\033[1;94m |\033[0;39m\033[1;91m Failed\n\033[0;39m",domain);
else {
printf(" \033[1;92m[+]\033[0;39m %s\033[1;94m |\033[0;39m\033[1;92m Success!\n",domain);
}
curl_easy_cleanup(curl);
}
}