Send a post Request With the Help Of PHP curl Operation


function fetch_data(){
$ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, "url for the post method");
        curl_setopt($ch, CURLOPT_POST, 1);

        curl_setopt($ch, CURLOPT_POSTFIELDS,
                    "postfieldname=postfieldvalue");

     
        // receive server response ...
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $server_output = curl_exec($ch);

        curl_close($ch);

     

       return  $server_output;
}

Comments

Popular posts from this blog

Merge JS and CSS file to make your codeigniter website faster using CARABINER library