Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Jan 14, 2014
1 parent d0117b5 commit f3af9e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/Unirest/Unirest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ private static function request($httpMethod, $url, $body = NULL, $headers = arra

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

0 comments on commit f3af9e8

Please sign in to comment.