<?php
function http_request_xml($url,$data = null,$arr_header = null){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
// curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
// curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
if (!empty($data)){
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
if(!empty($arr_header)){
curl_setopt($curl, CURLOPT_HTTPHEADER, $arr_header);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
// echo curl_getinfo($curl);
curl_close($curl);
unset($curl);
return $output;
}
$url = "http://blog56.test.com/api/get-details";
$arr_header[] = "Content-Type:application/json";
$arr_header[] = "Authorization: Bearer "."eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImZkODNiNDAyMTVlZTNmYTc3NDc5MmYwM2VmNDVmZWZhZGI0MGZjMmVmYTU3NWVmZGFjOWQ5OGZiOTY1N2I0ODhlNGJmZDFlNDdlMjNmMDUxIn0.eyJhdWQiOiIxIiwianRpIjoiZmQ4M2I0MDIxNWVlM2ZhNzc0NzkyZjAzZWY0NWZlZmFkYjQwZmMyZWZhNTc1ZWZkYWM5ZDk4ZmI5NjU3YjQ4OGU0YmZkMWU0N2UyM2YwNTEiLCJpYXQiOjE1NTIxMjg1NDgsIm5iZiI6MTU1MjEyODU0OCwiZXhwIjoxNTgzNzUwOTQ4LCJzdWIiOiIzIiwic2NvcGVzIjpbXX0.VOSQ6YW6qYpfGzulvN16mlhuwXHHPdpg7Qg2PH-C9JM0F6gjc8jO2o08HG0kEhdeFrf-RWleberkEz7TVXFDpWrRKZjyjhJa2hQe7qAi60tJHhIA2LDhScCe2HO_J_t7PNsRD49st8NCTADPdEjQUI9BilGecg6u7fKAEZUbifTPnkSx7zwlIl_TMDg-EnV3HUjsR_US2YeI3EuPh1b1bCyvTtpQtccTB_Bf8Juk3TiYslhMqR5qVwrhfMoSWtx2lqFsUCHFqyyTKn1-ChXcluwxvdJyZr3XhYq6X6JppZ4b3WtjLDEo53T5z3iMnKYf9UYKfeTkUKC8xz5WVxbkWLYXXa2kF9vkwumpC445Q3RkvZtKBc2D276vEJ3H5CJ-IFLg1Qs_mm2Arb0Z77vqz8AF4RLY59VwoRr9L633lUb6-E8P5iRTve4SEGacp-hQBmPbwODa1KIe8Tbbf2XR1FwTo_r9wQfT9zD2qjXEtv0GvF_PgP1qQeXk_QvqPWxZAggyGKd3wN4tA5UFjd69fbzw2eq-M-D8XvjYOR4tXylXTCv5_cZN7Z6HjkZxSh4oF8RYKir1Ry4DV0EG246Nhg-FVEkPEQEEs4ZZn08ZDsjF-8bAfiX0FbDu_hlT_X8XaE9zi_auA-GVmWIZYnfipd4Wmp2jnIIG2oafwhfk-v8"; //添加头,在name和pass处填写对应账号密码
$data['para'] = "1111";
$res = http_request_xml($url, $data, $arr_header);
var_dump($res);