pass additional params to request method to ask for associative json objects

This commit is contained in:
Ahmad Nassri
2014-12-17 18:54:05 -05:00
parent 6e615557cc
commit 2bd214f2d9

View File

@@ -160,7 +160,7 @@ class Unirest
* @throws Exception if a cURL error occurs * @throws Exception if a cURL error occurs
* @return HttpResponse * @return HttpResponse
*/ */
private static function request($httpMethod, $url, $body = NULL, $headers = array(), $username = NULL, $password = NULL) private static function request($httpMethod, $url, $body = NULL, $headers = array(), $username = NULL, $password = NULL, $json_decode_assoc = false)
{ {
if ($headers == NULL) if ($headers == NULL)
$headers = array(); $headers = array();
@@ -226,7 +226,7 @@ class Unirest
$body = substr($response, $header_size); $body = substr($response, $header_size);
$httpCode = $curl_info["http_code"]; $httpCode = $curl_info["http_code"];
return new HttpResponse($httpCode, $body, $header); return new HttpResponse($httpCode, $body, $header, $json_decode_assoc);
} }
private static function getArrayFromQuerystring($querystring) private static function getArrayFromQuerystring($querystring)