Thread: Module: Curl
View Single Post
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-30-2017 , 07:07   Re: Module: Curl
Reply With Quote #24

PHP Code:
new JSON:jsontest
new CURL:test 
PHP Code:
jsontest json_create();
json_set_string(jsontest"content", [[string]])
static 
szEncoded[4096];
json_encodejsontestszEncodedcharsmaxszEncoded ) );
test curl_easy_init()
curl_easy_setopt(testCURLOPT_URL"https://discordapp.com/api/webhooks/[redacted]");
curl_easy_setopt(testCURLOPT_POST1);
curl_easy_setopt(testCURLOPT_HEADER"Content-Type: application/json");
curl_easy_setopt(testCURLOPT_POSTFIELDSszEncoded);

log_amx("Enviando: %s"szEncoded)
curl_easy_perform(test"completeCallback"
I'm using Exolent's JSON include.
__________________

Last edited by gabuch2; 01-30-2017 at 07:10.
gabuch2 is offline