'Cant access my laravel api from postman but can access my web route

Good day techies, i had to work on a project, so i did php artisan route:list which i see all the route in the api route and which they all came out in this pattern

prepcrm.test | GET|HEAD | v1/client/cycles | v1::client.tutor-cycles | App\Http\Controllers\V1\Client\ClientClassController@getCycleRecords | api,client,auth

which the domain is prepcrm.test, so i created a virtual host in that domain name, and eveyry time I make a request from postman, the response I get back is "The requested URL was not found on this server." so i wrote a small block of code to just output hello world in my api route and web route and try to access it using postman, the web route request works fine but the api route is "exception": "Symfony\Component\HttpKernel\Exception\NotFoundHttpException".. have been on this for some days now, trying to make things work but to no futile.. What could have been done to not make the api route not working... Your contribution goes a long way. Thanks



Solution 1:[1]

On your request headers you should add

Accept => application/json

And sometimes maybe Content-type:

Content-Type => application/json

Example from postman

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1