$url = 'http://www.xxx.com';
$headers = [
'Content-Type: application/json',
];
$data = [];
$data = json_encode($data);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($curl, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($curl, CURLOPT_HEADER, 1);
// curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
// curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 60);
$output = curl_exec($curl);
// $info = curl_getinfo($curl);
curl_close($curl);