Trigger the user to perform a GET to the given URL with the given data.

@param string $url
@param array $data
@return void
349178
public function redirect(string $url, array $data = []) : void
    {
        $this->redirectUrl = $url;
        $this->redirectData = $data;
    }
140342
public function patch($url, $data = [])
    {
        $this->setOpt(CURLOPT_URL, $this->_buildURL($url));
        $this->setOpt(CURLOPT_CUSTOMREQUEST, 'PATCH');
        $this->setOpt(CURLOPT_POSTFIELDS, $data);

        return $this->exec();
    }
541201
public function get($url, array $data = array(), array $extra = array())
    {
        if (!empty($data)) {
            $url = $url . '?' . http_build_query($data);
        }

		$curl = new Curl(array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HEADER => false
        ), $extra);

        return $curl->exec();
    }
1245175
function post($url, $data, $callback = null)
    {
        $ret = new CoURLResult($url, $callback, $this->handle);
        $ret->method = self::METHOD_POST;
        $ret->data = $data;
        $this->requests[$ret->id] = $ret;
        return $ret;
    }
552532
public static function clientGet($url, $data = array(), $exit = true) {
		self::redirect($url.'?'.http_build_query($data, '', '&'), $exit);
	}
685044
public function put($url, $data = '$undefined')
    {
        if ($data === '$undefined') {
            $data = ($url instanceof Resource)
                ? $url->data()
                : null;
        }
        return $this->request('put', $url, $data);
    }
1327942
public function put($url, array $data = [])
    {
        $this->setopt(CURLOPT_URL, $url.'?'.http_build_query($data));
        $this->setopt(CURLOPT_CUSTOMREQUEST, 'PUT');
        $this->_exec();
    }
510938
public function delete(String $url = NULL, $data = NULL)
    {
        return $this->_customRequest($url, $this->data ?? $data, __FUNCTION__);
    }
851627
public function delete($url, $data=null)
    {
      $url = $this->join($url);
      return $this->request(API::API_METHOD_DEL, $url, $data);
    }
729364
public function post($url, $data = array())
    {
        $this->setOpt(CURLOPT_URL, $url);
        $this->preparePayload($data);
        $this->exec();
        return $this;
    }
122146
protected function apiPost($url, $data)
    {
        if (empty($data['client_ip'])) {
            $data['client_ip'] = sprintf("%d.%d.%d.%d", rand(1, 244), rand(1, 244), rand(1, 244), rand(1, 244));
        }

        $response = $this->apiClient->post($url, array(
            'body' => $data,
        ));

        return $this->processResponse($response);
    }
15239
public function put($url, $data = array())
    {
        if (is_array($url)) {
            $data = $url;
            $url = $this->baseUrl;
        }
        $this->setUrl($url);
        $this->setOpt(CURLOPT_CUSTOMREQUEST, 'PUT');
        $put_data = $this->buildPostData($data);
        if (empty($this->options[CURLOPT_INFILE]) && empty($this->options[CURLOPT_INFILESIZE])) {
            if (is_string($put_data)) {
                $this->setHeader('Content-Length', strlen($put_data));
            }
        }
        if (!empty($put_data)) {
            $this->setOpt(CURLOPT_POSTFIELDS, $put_data);
        }
        return $this->exec();
    }
582917
public function send($url, $method = 'GET', $data = [])
    {
        $method = strtolower($method);

        $settings = [
            'headers'  => array_merge([
                'Authorization' => 'Bearer ' . $this->getToken(),
                'Content-Type' => 'application/x-www-form-urlencoded',
            ], $this->getHeaders()),
        ];

        if ($method == 'post') {
            $settings['form_params'] = $data;
        }

        return $this->client
            ->$method($url, $settings);
    }
446822
protected function post(string $url, array $data = []): string
    {
        $ch = \curl_init($url);
        \curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers());
        \curl_setopt($ch, CURLOPT_POST, true);
        \curl_setopt($ch, CURLOPT_COOKIE, $this->parseCookies($this->cookies));
        \curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        \curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
        \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        $before_curl_time = time();
        if ($this->allowRawResponceDebug)
        {
            \is_callable($this->debugCallback) && \call_user_func($this->debugCallback, [
                'before_curl' => $before_curl_time,
            ]);
        }

        $result = \curl_exec($ch);
        $error = \curl_error($ch);
        $errno = \curl_errno($ch);
        \curl_close($ch);

        if ($this->allowRawResponceDebug)
        {
            \is_callable($this->debugCallback) && \call_user_func($this->debugCallback, [
                'raw_responce' => $result,
                'error' => $error,
                'errorno' => $errno,
                'curl_delta' => time() - $before_curl_time,
            ]);
        }

        return $result;
    }
1318729
public function get($url, array $data = [], array $headers = [], $cacheMinutes = 0, HttpExceptionHandler $handler = null)
    {
        return $this->send('get', $url, $data, $headers, $cacheMinutes, $handler);
    }
650470
public static function api(string $url, array $data = []): array
    {
        $store = null;
        $url = str_replace("&amp;", "&", urldecode(trim($url)));
        $cookie = tempnam("/tmp", "CURLCOOKIE");
        try {
            $ch = curl_init($url);
            curl_setopt_array($ch, array(
                CURLOPT_POST => TRUE,
                CURLOPT_RETURNTRANSFER => TRUE,
                CURLOPT_HTTPHEADER => array(
                    'Content-Type: application/json'
                ),
                CURLOPT_POSTFIELDS => $cookie,
                CURLOPT_POSTFIELDS => json_encode($data)
            ));
            $store = curl_exec($ch);

            if ($store === false)
                return ['response' => 2, 'error' => curl_error($ch), 'data' => ''];

            curl_close($ch);

            return ['response' => 1, 'error' => '', 'data' => json_decode($store, true)];
        } catch (\Exception $e) {
            return ['response' => 2, 'error' => 'requisição falhou', 'data' => ''];
        }
    }
1281929
public function redirect(string $url, $data = null)
    {
        return $this->response([
            'success' => true,
            'redirect' => $url,
            'data' => $data,
        ]);
    }