Request through the API client.

@return mixed
437636
protected function request($endpoint = null, $method, $params)
    {
        $results = $this->makeRequest($endpoint, $method, $params);

        return $results ? $this->newInstance($results, true) : null;
    }
688000
public static function getRequest()
    {
        if (self::$request) {
            return self::$request;
        }
        // Fall back to trying from the global state
        if (Controller::has_curr()) {
            return Controller::curr()->getRequest();
        }
    }
1348099
private function getHTTPClient()
    {
        if ($this->httpClient instanceof ClientInterface === false) {
            $this->httpClient = new HTTPClient();
        }

        return $this->httpClient;
    }
749990
public function getRequest(){
        if($this->httpCore != NULL){
            return $this->httpCore->httpRequest;
        }else{
            return $this->cronCore->cronRequest;
        }
    }
1128839
public function getHttpClient()
    {
        if (!$this->_service) {
            $this->_service = new Zend_Gdata_App();
        }
        $client = $this->_service->getHttpClient();
        return $client;
    }
726189
public function get()
    {
        $inputResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl('inputs')
        );

        return $this->getInputsFromResult($inputResult);
    }
1172434
protected function getRequest()
    {
        $url = $this->buildUrl($this->getBody());

        $response = $this->client->get($url, [
            'auth'    => $this->getAuth(),
            'headers' => [
                'Accept' => 'application/json',
            ],
        ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API.');
        }

        return $response;
    }
755724
protected function getHttpClient()
    {
        if ($this->httpClient === null) {
            $this->httpClient = new Client($this->guzzle);
        }

        return $this->httpClient;
    }
800728
public static function getRequest(): Request
    {
        $serverArr = $_SERVER;

        if ('cli' === PHP_SAPI) {
            // If we're running off the CLI, we're going to set some default
            // settings.
            $serverArr['REQUEST_URI'] = $_SERVER['REQUEST_URI'] ?? '/';
            $serverArr['REQUEST_METHOD'] = $_SERVER['REQUEST_METHOD'] ?? 'CLI';
        }

        $r = self::createFromServerArray($serverArr);
        $r->setBody(fopen('php://input', 'r'));
        $r->setPostData($_POST);

        return $r;
    }
902153
protected function postRequest()
    {
        $response = $this->client->post($this->buildUrl(),
            [
                'auth'    => $this->getAuth(),
                'json'    => $this->getBody(),
                'headers' => [
                    'Accept' => 'application/json',
                ],
            ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API. HTTP Error: '.$response->getStatusCode());
        }

        return $response;
    }
1288725
private function getRequest()
    {
        $error = null;

        do {
            if (array_key_exists('REQUEST_METHOD', $_SERVER) && $_SERVER['REQUEST_METHOD'] != 'POST') {
                $error = self::INVALIDREQUEST;
                break;
            };

            $request = !empty($_GET['rawRequest']) ? $_GET['rawRequest'] : file_get_contents('php://input');
            $this->request = json_decode($request, false);
            if ($this->request === null) {
                $error = self::PARSEERROR;
                break;
            }

            if ($this->request === []) {
                $error = self::INVALIDREQUEST;
                break;
            }

            // check for batch call
            if (is_array($this->request)) {
                if (count($this->request) > $this->MaxBatchCalls) {
                    $error = self::INVALIDREQUEST;
                    break;
                }

                $this->calls = $this->request;
                $this->isBatchCall = true;
            } else {
                $this->calls[] = $this->request;
            }
        } while (false);

        return $error;
    }
117669
public function & GetRequest () {
		if ($this->request === NULL) {
			$requestClass = $this->requestClass;
			$this->request = $requestClass::CreateInstance();
		}
		return $this->request;
	}
1071478
public function getRequest()
    {
        if (!$this->getContainer()->has(ServerRequestInterface::class)) {
            $this->getContainer()->share(ServerRequestInterface::class,function(){
                $beforeIndexPosition = strpos($_SERVER['PHP_SELF'],'/index.php');
                /**
                 * If there is some string before /index.php then remove this string from REQUEST_URI
                 */
                if(false !== $beforeIndexPosition && $beforeIndexPosition > 0){
                    $scriptUrl =  substr($_SERVER['PHP_SELF'],0,$beforeIndexPosition);
                    $_SERVER['REQUEST_URI'] = str_replace(['/index.php',$scriptUrl],'',$_SERVER['REQUEST_URI']);
                }
                return  ServerRequestFactory::fromGlobals()->withHeader('content-type', $this->getContentType());
            });
        }

        /** @var ServerRequestInterface $request */
        $request = $this->validateContract($this->getContainer()->get(ServerRequestInterface::class),
            ServerRequestInterface::class);
        return $request;
    }
846229
protected function getRequest()
    {
        global $argc, $argv, $args;

        if (php_sapi_name() == 'cli') {
            return trim('CLI ' . (isset($argv[1]) ? $argv[1] : ''));
        } else {
            return (empty($_SERVER['REQUEST_METHOD']) ? 'GET' : $_SERVER['REQUEST_METHOD']) . ' ' . $this->getPath();
        }
    }
883164
protected function sendRequest()
    {
        $parameters = $this->parameters->toArray();
        $parameters['key'] = $this->config['api_key'];

        $response = $this->guzzle->get($this->getRequestUrl(), [
            'query' => $parameters,
        ]);

        return json_decode((string)$response->getBody());
    }
756861
protected function get_update_api_client() {

        if ($this->updateapiclient === null) {
            $this->updateapiclient = \core\update\api::client();
        }

        return $this->updateapiclient;
    }
770648
public static function getHttpClient()
    {
        if(self::$httpClient) {
            return self::$httpClient;
        }
        $client = new Client();
        return self::$httpClient = $client;
    }