Authored by xiaowei

入参出参合并记录log

... ... @@ -168,8 +168,6 @@ class Yohobuy
}
if (!empty($data)) {
$url = self::httpBuildQuery($url, $data);
//log打印入参
UdpLog::info('get调用接口入参url:', $url);
} //echo $url;
/* 开启缓存的情况 */
if ($cache && USE_CACHE) {
... ... @@ -190,8 +188,8 @@ class Yohobuy
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
}
$result = curl_exec($ch);
//log打印出参
UdpLog::info('get调用接口出参:', $result);
//log打印
UdpLog::info('get调用接口入参url/出参:', 'in:'.$url.' out:'.$result);
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
... ... @@ -250,15 +248,13 @@ class Yohobuy
}
if (!empty($data)) {
$str = http_build_query($data, null, '&');
//log打印入参
UdpLog::info('POST调用接口入参url:', $url.'?'.$str);
// 新加支持application/x-www-form-urlencoded调用方式
//curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
}
$result = curl_exec($ch);
//log打印入参
UdpLog::info('POST调用接口出参', $result);
//log打印
UdpLog::info('get调用接口入参url/出参:', 'in:'.$url.'?'.$str.' out:'.$result);
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
... ...