public function redirect( Request $request, $endpoint, $path, $responseType = 'json' ) {
		// Set the Endpoints
		$this->getEndpoints();

		// Get Endpoint config.
		$this->setBaseUri( $this->getEndpointConfig( $endpoint )['endpoint'] );

		// Get Endpoint AUTH
		// $this->setAuthHeaders();

		// Get Required variables for the endpoint.
		// void

		// Add Proxy to request
		$request->attributes->add( [
			                           'proxy' => [
				                           'host'          => $this->getBaseUri(),
				                           'path'          => $path,
				                           'response_type' => $responseType,
			                           ],
		                           ] );


		// Create a call to the endpoint
		$this->prepareCall( null );

		// Prepare headers:
		$headers = $request->headers->all();
		if ( isset( $headers['host'] ) ) {
			unset( $headers['host'] );
		}

		// Set proxy headers
		$headers['bizhost-request-identifier'] = [ $request->get( 'bizhost-request-identifier' , null) ];
		$headers['bizhost-session-identifier'] = [ $request->get( 'bizhost-session-identifier' , null) ];


		// Prepare data
		$data = $request->all();


		// Execute call
		$this->execute( $request->getMethod(), $path, $data, $headers );

		// Catch the results
		return $this->getResponse( $responseType );
	}
public function redirect( Request $request, $endpoint, $path, $responseType = 'json' ) {
		// Set the Endpoints
		$this->getEndpoints();

		// Get Endpoint config.
		$this->setBaseUri( $this->getEndpointConfig( $endpoint )['endpoint'] );

		// Get Endpoint AUTH
		// $this->setAuthHeaders();

		// Get Required variables for the endpoint.
		// void

		// Add Proxy to request
		$request->attributes->add( [
			                           'proxy' => [
				                           'host'          => $this->getBaseUri(),
				                           'path'          => $path,
				                           'response_type' => $responseType,
			                           ],
		                           ] );


		// Create a call to the endpoint
		$this->prepareCall( null );

		// Prepare headers:
		$headers = $request->headers->all();
		if ( isset( $headers['host'] ) ) {
			unset( $headers['host'] );
		}

		// Set proxy headers
		$headers['bizhost-request-identifier'] = [ $request->get( 'bizhost-request-identifier' , null) ];
		$headers['bizhost-session-identifier'] = [ $request->get( 'bizhost-session-identifier' , null) ];


		// Prepare data
		$data = $request->all();


		// Execute call
		$this->execute( $request->getMethod(), $path, $data, $headers );

		// Catch the results
		return $this->getResponse( $responseType );
	}
public function redirect ( Request $ request , $ endpoint , $ path , $ responseType = 'json' ) { // Set the Endpoints $ this -> getEndpoints ( ) ; // Get Endpoint config. $ this -> setBaseUri ( $ this -> getEndpointConfig ( $ endpoint ) [ 'endpoint' ] ) ; // Get Endpoint AUTH // $this->setAuthHeaders(); // Get Required variables for the endpoint. // void // Add Proxy to request $ request -> attributes -> add ( [ 'proxy' => [ 'host' => $ this -> getBaseUri ( ) , 'path' => $ path , 'response_type' => $ responseType , ] , ] ) ; // Create a call to the endpoint $ this -> prepareCall ( null ) ; // Prepare headers: $ headers = $ request -> headers -> all ( ) ; if ( isset ( $ headers [ 'host' ] ) ) { unset ( $ headers [ 'host' ] ) ; } // Set proxy headers $ headers [ 'bizhost-request-identifier' ] = [ $ request -> get ( 'bizhost-request-identifier' , null ) ] ; $ headers [ 'bizhost-session-identifier' ] = [ $ request -> get ( 'bizhost-session-identifier' , null ) ] ; // Prepare data $ data = $ request -> all ( ) ; // Execute call $ this -> execute ( $ request -> getMethod ( ) , $ path , $ data , $ headers ) ; // Catch the results return $ this -> getResponse ( $ responseType ) ; }
Redirect the API call to the micro service

@param Request $request
@param string  $endpoint
@param string  $path
@param string  $responseType

@return mixed
@throws \Exception
Redirect the API call to the micro service