Perform a redirect to a new URL, in two flavors: header or location.

@param string  $uri    The URI to redirect to
@param string  $method
@param integer $code   The type of redirection, defaults to 302

@return $this
@throws \CodeIgniter\HTTP\Exceptions\HTTPException For invalid status code.