arronjazz
arronjazz
BBuildShip
Created by arronjazz on 4/30/2024 in #❓・buildship-help
How to write a php curl api call (Please HELP) ? I have tried this
My buildship query parameters are : prompt, content_buffer $data = array( 'prompt' => "Who is the us president ?", 'content_buffer' => ' '); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($data) ); curl_setopt($ch, CURLOPT_POST, count($data)); /curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' ));/ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch); curl_close($ch); This does not work.
3 replies