i made a post route in laravel but when access it i find that get request was sent
this is error Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not supported for route api/login. Supported methods: POST
This happens primarily because of validation issues of API as the Laravel validator sends back to the same URL, Like in this case, it is redirecting back to the login route by the GET method so it's saying you method not allowed.
For this issue, you need to change Postman settings where you need to uncheck Automatically follow redirects to off.
If you're making the request from a tool like Postman or curl, ensure that you include the Accept: application/json
header in your request. This informs Laravel to respond with JSON.
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