-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathHttpPost.c
More file actions
22 lines (21 loc) · 762 Bytes
/
HttpPost.c
File metadata and controls
22 lines (21 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include "curl/curl.h"
#include "modules/HttpPost.h"
#include <string.h>
void mainMenuHttpPost(char* domain, const char* MESSAGE) {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, domain);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, MESSAGE);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(MESSAGE));
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);
}
}