pass additional params to request method to ask for associative json objects
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user