src/EasyCurl.php
private function exec()
    {
        $this->buildQuery();

        $this->response = curl_exec($this->curl);

        // curl
        $this->curlErrorCode = curl_errno($this->curl);
        $this->curlErrorMessage = curl_error($this->curl);
        $this->curlError = !($this->curlErrorCode === 0);

        // http
        $this->httpStatusCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
        $this->httpError = in_array(floor($this->httpStatusCode / 100), array(4, 5));
        $this->httpErrorCode = $this->httpError ? $this->httpStatusCode : 0;

        // base
        $this->error = $this->curlError || $this->httpError;

        if (!$this->curlError) {
            $this->responseHeaders = $this->headerParse($this->rawResponseHeaders);
        }

        if ($this->httpError) {
            $this->httpErrorMessage = $this->responseHeaders['Status-Line'];
        }

        if ($this->autoJSON && $this->isJSON($this->response)) {
            return json_decode($this->response, true);
        }

        return $this->response;
    }
private function exec()
    {
        $this->buildQuery();

        $this->response = curl_exec($this->curl);

        // curl
        $this->curlErrorCode = curl_errno($this->curl);
        $this->curlErrorMessage = curl_error($this->curl);
        $this->curlError = !($this->curlErrorCode === 0);

        // http
        $this->httpStatusCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
        $this->httpError = in_array(floor($this->httpStatusCode / 100), array(4, 5));
        $this->httpErrorCode = $this->httpError ? $this->httpStatusCode : 0;

        // base
        $this->error = $this->curlError || $this->httpError;

        if (!$this->curlError) {
            $this->responseHeaders = $this->headerParse($this->rawResponseHeaders);
        }

        if ($this->httpError) {
            $this->httpErrorMessage = $this->responseHeaders['Status-Line'];
        }

        if ($this->autoJSON && $this->isJSON($this->response)) {
            return json_decode($this->response, true);
        }

        return $this->response;
    }
Execution request

@return mixed