PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t (id int primary key auto_increment, val int);
Copy Clear
Copy Format Clear
<?php function curlWrapper($urlMethod, $data) { $json = json_encode($data); $ch = curl_init(); define("HOAXFLOW", "something"); curl_setopt($ch, CURLOPT_URL, 'https://site.site/api?'.$urlMethod.'='.HOAXFLOW); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //117* curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return $response; } $res = curlWrapper('Method', ['test'=>'test']);
Show:  
Copy Clear