Commit d4a960fa authored by 杨培's avatar 杨培

php curl 优化

parent 51caac20
......@@ -142,7 +142,7 @@ class Client
return [$sign, $timestamp, $nonce];
}
protected function request($url, $post='', $headers=array()) {
protected function request($url, $post='', $headers=[]) {
$ci = curl_init();
/* Curl settings */
curl_setopt($ci, CURLOPT_USERAGENT, 'PHP/'.PHP_VERSION.' Client/'.$this->clientId);
......@@ -158,6 +158,8 @@ class Client
$post && curl_setopt($ci, CURLOPT_POSTFIELDS, $post);
}
$header[] = 'Expect:';
curl_setopt($ci, CURLOPT_URL, $url);
curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);
//curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);
......
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2017/6/28
* Time: 17:13
*/
return [
'ucenter' => [
'apiUrl' => 'http://u.ibanshou.cn/api/server',
'clientId' => 'common',
'clientSecret' => ''
],
'xue' => [
'apiUrl' => 'http://xue.ibanshou.cn/api',
'clientId' => 'common',
'clientSecret' => ''
],
'code' => [
'apiUrl' => 'http://code.ibanshou.cn/site/api-server',
'clientId' => 'common',
'clientSecret' => ''
]
];
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment