Skip to content

Argument 1 passed to Dingo\Api\Exception\InternalHttpException::__construct() must be an instance of Illuminate\Http\Response, instance of Illuminate\Http\RedirectResponse given, called in vendor/dingo/api/src/Dispatcher.php on line 543 and defined #998

@mohammedibrahim

Description

@mohammedibrahim

Hello there,

I am trying to make and internal request but it ends with this error

Argument 1 passed to Dingo\Api\Exception\InternalHttpException::__construct() must be an instance of Illuminate\Http\Response, instance of Illuminate\Http\RedirectResponse given, called in /var/www/htr/api/vendor/dingo/api/src/Dispatcher.php on line 543 and defined

here is my routes.php

$api->version('v1', ['middleware' => 'guest', 'protected' => false], function ($api) {
    $api->group(['prefix' => 'v1',], function ($api) {
        $api->post('register', '\App\Http\Controllers\APIs\ApiAuthController@register');
    });
});

The internal request

        $response = $this->api->version(env('API_VERSION', 'v1'))->post(env('API_VERSION', 'v1').'/register', [
            'name' => $user->name,
            'email' => $user->email,
            'password' => Hash::make('123456')
        ]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions