在Laravel POST请求上重定向302

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?

it looks like in postman you should point that the data you send is 'x-www-url-formurlencoded'

Http status code 302 is used for redirection. It can be due to server side problem, Please check your laravel project's error log file or apache's error log file.

When you try to POST request by Postman,you need to add _token field and it's value which is used to be protect XSS attack.See https://laravel.com/docs/5.2/routing#csrf-protection

When visiting the endpoint using Postman, set the Header

Accept: application/json

or Laravel would never know it's an API client and thus redirect with 302 message. It's the mechanism for latest Laravel version since they provide api.php router beside web.php router.

This might be useful for other users that having the same problem cannot solve it with the solution above:

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.