Welcome Guest, Not a member yet? Register   Sign In
Why does HTTP 303 error occur?
#1

I am developing a RESTful API and I started with the User module. I created a route for user creation with the following code:

php

$routes->post('users', 'UsersController::create');
However, when I tried to access the endpoint using Insomnia, I kept getting redirected to the default controller with the message "HTTP 303 See Other". Interestingly, when I changed the verb to PUT and the route to "put()", everything worked smoothly.

My question is: Did I miss a step in the process?

Here are some additional details about my code:

In the Routes.php file, I have set the default namespace to 'App\Controllers', default controller to 'Home', default method to 'index', and disabled URI dashes translation. I have also overridden the 404 error page and enabled auto-routing.

My UsersController is extending the CodeIgniter\RESTful\ResourceController.
Reply
#2

Please READ:

What Is a 303 See Other Error?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB