lithium\net\http\Service::_request PHP Method

_request() protected method

Instantiates a request object (usually an instance of http\Request) and tests its properties based on the request type and data to be sent.
protected _request ( string $method, string $path, string $data, string $options ) : object
$method string The HTTP method of the request, i.e. `'GET'`, `'HEAD'`, `'OPTIONS'`, etc. Can be passed in upper- or lower-case.
$path string The
$data string
$options string
return object Returns an instance of `http\Request`, configured with an HTTP method, query string or POST/PUT/PATCH data, and URL.
    protected function _request($method, $path, $data, $options)
    {
        $defaults = array('type' => 'form');
        $options += $defaults + $this->_config;
        $request = $this->_instance('request', $options);
        $request->path = str_replace('//', '/', "{$request->path}{$path}");
        $request->method = $method = strtoupper($method);
        $hasBody = in_array($method, array('POST', 'PUT', 'PATCH'));
        $hasBody ? $request->body($data) : ($request->query = $data);
        return $request;
    }