|
@@ -39,18 +39,18 @@ function http_request($url, $params = array(), $method = 'GET', $multi = false,
|
|
|
curl_setopt($ci, CURLOPT_POSTFIELDS, $params);
|
|
|
$headers[] = 'Expect: ';
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else {
|
|
|
curl_setopt($ci, CURLOPT_POSTFIELDS, http_build_query($params));
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case 'DELETE':
|
|
|
case 'GET':
|
|
|
- $method == 'DELETE' && curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
|
|
+ if($method == 'DELETE') {
|
|
|
+ curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
|
|
+ }
|
|
|
if (!empty($params)) {
|
|
|
- $url = $url . (strpos($url, '?') ? '&' : '?')
|
|
|
- . (is_array($params) ? http_build_query($params) : $params);
|
|
|
+ $url = $url . (strpos($url, '?') ? '&' : '?') . (is_array($params) ? http_build_query($params) : $params);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -62,6 +62,7 @@ function http_request($url, $params = array(), $method = 'GET', $multi = false,
|
|
|
|
|
|
$response = curl_exec($ci);
|
|
|
curl_close($ci);
|
|
|
+
|
|
|
return $response;
|
|
|
}
|
|
|
|