Answer the question
In order to leave comments, you need to log in
How to send a POST request to slack?
Hello! I can't send a message to slack, I try like this:
$url = 'https://hooks.slack.com/services/{token}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_PROXY,"proxy ip");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'payload={"text":"test"}');
$result = curl_exec($ch);
curl_close($ch);
var_dump($result);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question