diff --git a/src/Beanstream/communications/HttpConnector.php b/src/Beanstream/communications/HttpConnector.php index dedee45..8d67712 100755 --- a/src/Beanstream/communications/HttpConnector.php +++ b/src/Beanstream/communications/HttpConnector.php @@ -113,8 +113,10 @@ private function request($http_method = NULL, $url, $data = NULL) throw new ConnectorException('Unexpected response format', 0); } + $info = curl_getinfo($req); + //check for return errors from the API - if (isset($res['code']) && 1 < $res['code'] && !($req['http_code'] >= 200 && $req['http_code'] < 300)) { + if (isset($res['code']) && 1 < $res['code'] && !($info['http_code'] >= 200 && $info['http_code'] < 300)) { $message = $res['message']; if ( ! empty($res['details'])) { $details = array();