I am trying to receive a shoppy webhook and put it in my database. But there for I am first sending it to the discord webhook using json_encode. To see what the $_POST
variable contains.
function postToDiscord($message, $webhook)
{
$data = array("content" => $message, "username" => "TEST");
$curl = curl_init($webhook);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
return curl_exec($curl);
}
postToDiscord(json_encode(utf8ize($_POST)), "WEBHOOK WAS HERE");
Here is a link to the Shoppy api; click. It says it should deliver the information with $_POST
, but when I use the webhook simulator, I only receive []
. Does somebody has a solution for this?