Professional Documents
Culture Documents
$response_body,
$response_code,
$response_headers
) {
$resp = null;
if ($response_body) {
$resp = json_decode($response_body, true);
$jsonError = json_last_error();
if ($resp === null && $jsonError !== JSON_ERROR_NONE) {
$msg = "Invalid response body: $response_body "
. "(HTTP response code: $response_code, json_last_error:
$jsonError)";
throw new Lunar_Exception_ApiException($msg, $response_code,
$response_body);
}
}
return $resp;
}