troubleshoot 26 lines of simple Get request in php using curl

You’re passing the ‘text’ parameter as part of the headers, where you should be sending them as a POST request. Try this instead (untested!)

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Api-Key: quickstart-QUdJIGlzIGNvbWluZy4uLi4K"
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'text' => 'This is good' ]);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top