I'm developing a Laravel Web Service
.
When I try my POST
routes with web forms, everything works fine, but when I try the same with a REST Client like Postman
it doesn't get me the response that should.
It gives me status code 302
, and redirects to "/". What's the problem?
You can follow these five steps to fix HTTP 302 errors on your website: Determine whether the redirects are appropriate or not by examining the URLs that are issuing the 302 redirects. Check your plugins to make sure any redirect settings are valid. Ensure that your WordPress URL settings are configured correctly.
What is an HTTP 302? The 302 status code is a redirection message that occurs when a resource or page you're attempting to load has been temporarily moved to a different location. It's usually caused by the web server and doesn't impact the user experience, as the redirect happens automatically.
302 response status code is not an error. Everything is OK. That means that route to which successful login should be redirected has been found.
A redirect 302 is a code that tells visitors of a specific URL that the page has been moved temporarily, directing them directly to the new location. In other words, redirect 302 is activated when Google robots or other search engines request to load a specific page.
This might be useful for other users that having the same problem cannot solve it with the accepted solution.
Make sure that the form fields names for instance <input type="text" name="document_name">
(document_name), match the names of the rules fields declared in the model. public static $rules = ['document_name' => 'required|string'];
It doesn't throw any errors, nothing in the logs, it just redirects to the form, therefore the difficulty to find the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With