<?php
namespace App\Http\Model;
use Illuminate\Routing\Controller as BaseController;
class curl_post extends BaseController
{
public function curl($url,$data){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type'=>'application/json',
'Connection'=>'keep-alive'
));
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
}