Client-side GET: This function builds the full HTTP URL with parameters and redirects via Location header.

@param string $url Destination URL
@param array $data Data
@param boolean $exit Whether to call exit() right after redirection
552532
public static function clientGet($url, $data = array(), $exit = true) {
		self::redirect($url.'?'.http_build_query($data, '', '&'), $exit);
	}
806271
public function get($url, $data) {
        curl_setopt($this->_ch, CURLOPT_CUSTOMREQUEST, 'GET');
        curl_setopt($this->_ch, CURLOPT_URL, sprintf( "%s?%s", $url, http_build_query($data, '', '&', PHP_QUERY_RFC3986)));
        curl_setopt($this->_ch, CURLOPT_HTTPHEADER, array("Accept:application/json", "Content-Type: application/json"));

        return $this->_exec();
    }
708497
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
        if (!$this->active) {
            return;
        }

        if (is_array($this->Auth->loginAction)) {
            if (!empty($this->Auth->loginAction['controller'])) {
                $this->controller = $this->Auth->loginAction['controller'];
            }

            if (!empty($this->Auth->loginAction['action'])) {
                $this->loginAction = $this->Auth->loginAction['action'];
            }

            if (!empty($this->Auth->loginAction['plugin'])) {
                $this->plugin = $this->Auth->loginAction['plugin'];
            }
        }

        if (empty($this->controller)) {
            $this->controller = Inflector::pluralize($this->model);
        }

        // Is called after user login/logout validates, but before auth redirects
        if ($controller->plugin == Inflector::camelize($this->plugin) && $controller->name == Inflector::camelize($this->controller)) {
            $data = $controller->request->data;
            $action = isset($controller->request->params['action']) ? $controller->request->params['action'] : 'login';

            switch ($action) {
                case $this->loginAction:
                    if (isset($data[$this->model])) {
                        $this->login($data[$this->model]);
                    }
                break;

                case $this->logoutAction:
                    $this->logout();
                break;
            }
        }
    }
1169402
public function delete($url, $data = [], array $options = [])
    {
        $options = $this->_mergeOptions($options);
        $url = $this->buildUrl($url, [], $options);

        return $this->_doRequest(Request::METHOD_DELETE, $url, $data, $options);
    }
696806
public function redirect($url = null, $exitAfter = true)
    {
        if (empty($url)) {
            $authRequest = $this->_stateMgr->get('authRequest');
            /* @var AuthRequest $authRequest */
            if ($authRequest) {
                $url = $authRequest->getReturnUrl();
                $this->_stateMgr->set('authRequest');
            }
        }
        parent::redirect($url, $exitAfter);
    }
579971
public static function post($url, $data = [], $options = [])
    {
        $options['data'] = $data;
        return self::doRequest('post', $url, $options);
    }
1107005
public function head($url, $data = null, $header = [])
    {
        return $this->exec($url, false, 'head', $header);
    }
280708
public function trace($url, $data = [], array $options = [])
    {
        $options = $this->_mergeOptions($options);
        $url = $this->buildUrl($url, [], $options);

        return $this->_doRequest(Request::METHOD_TRACE, $url, $data, $options);
    }
1219475
public function getSafeRedirectUrl($default, $data = null, $key = 'redirect') {
		$redirectUrl = $data ?: ($this->Controller->getRequest()->getData($key) ?: $this->Controller->getRequest()->getQuery($key));
		if ($redirectUrl && (mb_substr($redirectUrl, 0, 1) !== '/' || mb_substr($redirectUrl, 0, 2) === '//')) {
			$redirectUrl = null;
		}

		return $redirectUrl ?: $default;
	}
959794
static function setRedirectData(M $m, $url, array $p = [], $forceGet = false) {$m->iiaSet(
		self::$REDIRECT_DATA, ['forceGet' => $forceGet, 'p' => $p, 'url' => $url]
	);}
223713
public static function redirect($url, $rewrite = true) {
		if ($rewrite) {
			// TODO: I don't actually know why there is a try/catch around this?
			try {
				$url = \Skeleton\Core\Util::rewrite_reverse($url);
			} catch (\Exception $e) { }
		}

		header('Location: '.$url);
		echo 'Redirecting to : '.$url;
		exit;
	}
173435
private function _onHide($url,$options,$exit = false ){
		$onHide = $options['onHide'];
		unset($options['onHide']);
		
		
		if ($onHide === true) {
			$exit = true;
		}
		
		return array($url, $options, $exit);	
	}
578209
public function delete($url, $data = [])
    {
        $this->setOpt(CURLOPT_URL, $this->_buildURL($url, $data));
        $this->setOpt(CURLOPT_CUSTOMREQUEST, 'DELETE');

        return $this->exec();
    }
1343154
protected static function format_get($url, $data) {
		if (!empty($data)) {
			$url_parts = parse_url($url);
			if (empty($url_parts['query'])) {
				$query = $url_parts['query'] = '';
			}
			else {
				$query = $url_parts['query'];
			}

			$query .= '&' . http_build_query($data, null, '&');
			$query = trim($query, '&');

			if (empty($url_parts['query'])) {
				$url .= '?' . $query;
			}
			else {
				$url = str_replace($url_parts['query'], $query, $url);
			}
		}
		return $url;
	}
704301
public function post($url, $data) {
        foreach ($data as $key => $v) {
            if (is_array($v)) {
                foreach ($v as $k => $vv) {
                    if ($vv{0} == '@') {
                        $data[ $key ][ $k ] = new \CURLFile(substr($vv, 1));
                    }
                }
            } else if ($v{0} == '@') {
                $data[ $key ] = new \CURLFile(substr($v, 1));
            }
        }
        $options = [
            CURLOPT_URL            => $url,
            CURLOPT_POST           => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POSTFIELDS     => $data
        ];
        curl_setopt_array($this->ch, $options);
        $rst = curl_exec($this->ch);
        if ($rst === false) {
            $this->error     = curl_error($this->ch);
            $this->errorCode = '500';
            $rst             = false;
        } else {
            $code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
            if ($code != '200') {
                $this->error     = '[' . $code . ']' . get_status_header_desc($code);
                $this->errorCode = $code;
                $rst             = false;
            }
        }

        return $rst;
    }
538231
public function post($url, $data = '', array $headers = [])
    {
        return $this->executor->execute(
            $url,
            [
                CURLOPT_POST => true,
                CURLOPT_HTTPHEADER => $headers,
                CURLOPT_POSTFIELDS => $data,
            ]
        );
    }
1165300
public function send($url, $method = 'GET', $data = null, callable $callback = null)
    {
        $this->curl($url);
        $this->setDefaultOptions();

        if (is_array($this->options))
        {
            if (count($this->options) > 0)
            {
                foreach ($this->options as $key => $value)
                {
                    $this->setOption($key, $value);
                }
            }
        }

        if ($method !== self::GET)
        {
            $this->method($method);
        }

        if ($method === self::POST || $method === self::PUT || $method === self::DELETE)
        {
            $this->setOption(CURLOPT_POSTFIELDS, $data);
        }

        $response = $this->execute();

        if (!$response)
        {
            $this->error();
        }

        $this->getInfo();
        $this->close();

        if ( is_callable($callback) )
        {
            $callback($this->response, $this->info, $this->errors);
        }

        return $response;
    }