if (empty($uri) ||
empty($userAgent)) { throw new InvalidArgumentException('You must supply the parameters: uri, userAgent.'
);
} $this->
populateHeaders();
if ( $body === 'php://input'
// php://input is not available with enctype="multipart/form-data".
// See https://www.php.net/manual/en/wrappers.php.php#wrappers.php.input
&&
strpos($this->
getHeaderLine('Content-Type'
), 'multipart/form-data'
) === false
&&
(int) $this->
getHeaderLine('Content-Length'
) <=
$this->
getPostMaxSize() ) { // Get our body from php://input
$body =
file_get_contents('php://input'
);
} $this->config =
$config;
$this->uri =
$uri;
$this->body = !
empty($body) ?
$body : null;
$this->userAgent =
$userAgent;
$this->validLocales =
$config->supportedLocales;