original_string: protected function _redirect(ServerRequest $request, Response $response) {
  		$message = $request->getSession()->consume($this->_config['flashKey']);
  		$url = $response->getHeader('Location')[0];
  		$status = $response->getStatusCode();
  
  		$json = JsonEncoder::encode([
  			// Error and content are here to make the output the same as previously
  			// with the component, so existing unit tests don't break.
  			'error' => null,
  			'content' => null,
  			'_message' => $message,
  			'_redirect' => compact('url', 'status'),
  		], $this->_config['jsonOptions']);
  
  		$response = $response->withStatus(200)
  			->withoutHeader('Location')
  			->withHeader('Content-Type', 'application/json; charset=' . $response->getCharset())
  			->withStringBody($json);
  
  		return $response;
  	}
code: protected function _redirect(ServerRequest $request, Response $response) {
  		$message = $request->getSession()->consume($this->_config['flashKey']);
  		$url = $response->getHeader('Location')[0];
  		$status = $response->getStatusCode();
  
  		$json = JsonEncoder::encode([
  			// Error and content are here to make the output the same as previously
  			// with the component, so existing unit tests don't break.
  			'error' => null,
  			'content' => null,
  			'_message' => $message,
  			'_redirect' => compact('url', 'status'),
  		], $this->_config['jsonOptions']);
  
  		$response = $response->withStatus(200)
  			->withoutHeader('Location')
  			->withHeader('Content-Type', 'application/json; charset=' . $response->getCharset())
  			->withStringBody($json);
  
  		return $response;
  	}
code_tokens: protected function _redirect ( ServerRequest $ request , Response $ response ) { $ message = $ request -> getSession ( ) -> consume ( $ this -> _config [ 'flashKey' ] ) ; $ url = $ response -> getHeader ( 'Location' ) [ 0 ] ; $ status = $ response -> getStatusCode ( ) ; $ json = JsonEncoder :: encode ( [ // Error and content are here to make the output the same as previously // with the component, so existing unit tests don't break. 'error' => null , 'content' => null , '_message' => $ message , '_redirect' => compact ( 'url' , 'status' ) , ] , $ this -> _config [ 'jsonOptions' ] ) ; $ response = $ response -> withStatus ( 200 ) -> withoutHeader ( 'Location' ) -> withHeader ( 'Content-Type' , 'application/json; charset=' . $ response -> getCharset ( ) ) -> withStringBody ( $ json ) ; return $ response ; }
docstring: Generate a JSON response encoding the redirect
  
  @param \Cake\Http\ServerRequest $request The request.
  @param \Cake\Http\Response $response The response.
  @return \Cake\Http\Response A response.
  @throws \RuntimeException
docstring_tokens: Generate a JSON response encoding the redirect