Creates and configures an instance of HTTP_Request2

@return HTTP_Request2
771794
protected function createRequest()
    {
        if (!$this->requestPrototype) {
            $request = new HTTP_Request2($this->url);
        } else {
            $request = clone $this->requestPrototype;
            $request->setUrl($this->url);
        }

        foreach (array_keys($this->getProject()->getProperties()) as $propName) {
            if (0 === strpos($propName, 'phing.http.')) {
                $request->setConfig(substr($propName, 11), $this->getProject()->getProperty($propName));
            }
        }

        // set the authentication data
        if (!empty($this->authUser)) {
            $request->setAuth(
                $this->authUser,
                $this->authPassword,
                $this->authScheme
            );
        }

        foreach ($this->configData as $config) {
            $request->setConfig($config->getName(), $config->getValue());
        }

        foreach ($this->headers as $header) {
            $request->setHeader($header->getName(), $header->getValue());
        }

        return $request;
    }
907831
public function build()
    {
        $uri = $this->trimTrailingSlashes($this->request->getUri()->getPath());
        $method = mb_strtoupper($this->request->getMethod());

        foreach ($this->routes[$method] as $routeUri => $action) {
            $arguments = $this->match($uri, $routeUri);

            if (!is_null($arguments)) {
                return $this->constructAction($action, $arguments);
            }
        }

        throw new HTTPException('Not found', 404);
    }
860933
public function build(): SetExtraHTTPHeadersRequest
	{
		$instance = new SetExtraHTTPHeadersRequest();
		if ($this->headers === null) {
			throw new BuilderException('Property [headers] is required.');
		}
		$instance->headers = $this->headers;
		return $instance;
	}
797349
protected function createRequestUri()
    {
        if ($this->protocol == '') {
            $this->protocol = "http";
        }
        $this->request = $this->protocol . '://' . $this->serverData['HTTP_HOST'] . $this->serverData['REQUEST_URI'];
        $this->debugMessage[] = 'REQUEST: ' . $this->request;
    }
889913
public function create() {
        $data = Values::of(array());

        $payload = $this->version->create(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new ConfigurationInstance($this->version, $payload);
    }
343064
public function make()
    {
        $this->setDefaultHeaders();

        $startTime = microtime(true);
        $result = $this->httpClient->request($this->getMethod(), $this->getURL(), $this->getPayload());
        $endTime = microtime(true);

        $this->response = new Response();
        $this->response->setExecutionTime(round(($endTime - $startTime), 5))
            ->setStatusCode($result->getStatusCode());

        // set the request ID for remote debugging if it is present            
        if (!empty(($requestID = $result->getHeader('X-Moltin-Request-Id')))) {
            $this->response->setRequestID($requestID[0]);
        }

        $body = json_decode($result->getBody());
        $this->response->setRaw($body)->parse();

        return $this;
    }
114718
public function getRequest()
	{
	    $name = 'web.request';
	    if (!Ioc::has($name)) {
	        Ioc::setShared($name, function(){
	            return Request::createFromGlobals($_SERVER);
	        });
	    }
	    
	    return Ioc::get($name);
	}
1139518
public function build(): StartRequest
	{
		$instance = new StartRequest();
		$instance->categories = $this->categories;
		$instance->options = $this->options;
		$instance->bufferUsageReportingInterval = $this->bufferUsageReportingInterval;
		$instance->transferMode = $this->transferMode;
		$instance->streamFormat = $this->streamFormat;
		$instance->streamCompression = $this->streamCompression;
		$instance->traceConfig = $this->traceConfig;
		return $instance;
	}
836366
public static function current () {
      if ( php_sapi_name() == 'cli' )
        throw new Exception ( 'Cannot generate an HTTP request from CLI.' );
      
      // collect headers from _SERVER
      $headers = array();
      foreach ( Request::$phpHeaderMap as $phpName => $httpName )
        if ( isset( $_SERVER[$phpName] ) )
          $headers[$httpName] = $_SERVER[$phpName];
        
      return new Request (
        $_SERVER['REQUEST_URI'],
        $_REQUEST,
        $_POST,
        $_FILES,
        strtoupper( $_SERVER['REQUEST_METHOD'] ),
        $headers,
        $_SERVER['REMOTE_ADDR'],
        isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? TRUE : FALSE
      );
    }
722655
protected function createDefaultRequest()
    {
        $request = Request::createFromGlobals();
        $session = new Session();

        $request->setSession($session);

        return $request;
    }
162191
public function build(): ReloadRequest
	{
		$instance = new ReloadRequest();
		$instance->ignoreCache = $this->ignoreCache;
		$instance->scriptToEvaluateOnLoad = $this->scriptToEvaluateOnLoad;
		return $instance;
	}
1182423
public function make()
    {
        return new Request($this->method, $this->target, $this->server, $this->cookies, $this->data, $this->files, $this->queries, $this->attributes, $this->uri, $this->headers, $this->stream, $this->version);
    }
962834
public function buildRequest()
    {
        $request = $this->getPayPalRequest();
        $request->setParameter('TOKEN', $this->getSession()->getVariable('oepaypal-token'));

        return $request;
    }
1286857
public function build(): GetRequestPostDataRequest
	{
		$instance = new GetRequestPostDataRequest();
		if ($this->requestId === null) {
			throw new BuilderException('Property [requestId] is required.');
		}
		$instance->requestId = $this->requestId;
		return $instance;
	}
886360
protected function createConsoleRequest(): Request
    {
        $requestStack = $this->getRequestStack();
        $request = $requestStack->getCurrentRequest();
        if (!$request instanceof Request) {
            $request = new Request();
            $requestStack->push($request);
        }

        $request->attributes->set('pbjx_console', true);
        $request->attributes->set('pbjx_bind_unrestricted', true);

        return $request;
    }
6053
public function createRequest() {
        $request = new \Amp\Artax\Request();
        $url = null;
        $request->setMethod('');



        //Parameters are parsed and set, lets prepare the request
        if ($url == null) {
            $url = "https://api.github.com";
        }
        $request->setUri($url);

        return $request;
    }
593735
public function createRequest()
    {
        if ($this->request == null){
            $this->request = Request::fromPhpContext($this);
        }

        return $this->request;
    }