system/Validation/Validation.php
public function withRequest(RequestInterface $request): ValidationInterface
	{
		if (in_array($request->getMethod(), ['put', 'patch', 'delete']))
		{
			$this->data = $request->getRawInput();
		}
		else
		{
			$this->data = $request->getVar() ?? [];
		}

		return $this;
	}
public function withRequest(RequestInterface $request): ValidationInterface
	{
		if (in_array($request->getMethod(), ['put', 'patch', 'delete']))
		{
			$this->data = $request->getRawInput();
		}
		else
		{
			$this->data = $request->getVar() ?? [];
		}

		return $this;
	}
Takes a Request object and grabs the input data to use from its
array values.

@param \CodeIgniter\HTTP\RequestInterface|\CodeIgniter\HTTP\IncomingRequest $request

@return \CodeIgniter\Validation\ValidationInterface