This commit is contained in:
thefosk
2014-01-14 10:34:19 -08:00
parent d0117b5125
commit f3af9e8196

View File

@@ -171,13 +171,13 @@
$ch = curl_init(); $ch = curl_init();
if ($httpMethod != HttpMethod::GET) { if ($httpMethod != HttpMethod::GET) {
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, $httpMethod); curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, $httpMethod);
if( is_array($body) || $body instanceof Traversable ) { if( is_array($body) || $body instanceof Traversable ) {
Unirest::http_build_query_for_curl($body, $postBody); Unirest::http_build_query_for_curl($body, $postBody);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postBody); curl_setopt ($ch, CURLOPT_POSTFIELDS, $postBody);
} else { } else {
curl_setopt ($ch, CURLOPT_POSTFIELDS, $body); curl_setopt ($ch, CURLOPT_POSTFIELDS, $body);
} }
} else if (is_array($body)) { } else if (is_array($body)) {
if (strpos($url,'?') !== false) { if (strpos($url,'?') !== false) {
$url .= "&"; $url .= "&";