Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nafeeur10's avatar

How to Test Get Request using Postman for Laravel API

I am new in Laravel API.

Route::group([
    'prefix' => 'data',
], function () {
    Route::get('stripeKeyStore', 'UserSettingController@stripeKeyStore');
});

This is my api.php route.

public function stripeKeyStore()
{
      return "GET WORKING";
      //response()->json([$request->all()]);
}

This is the Function.

Now I am trying to Access this using Postman. But giving this Result!!!

https://ibb.co/1KLGsH6 Image of PostMan

0 likes
7 replies
tykus's avatar

You are getting a web page back; if you click the Preview tab in the result window, you will see the rendered page.

It appears you are not actually hitting the endpoint you expected; did you define that Route in api.php, or in web.php?

1 like
nafeeur10's avatar

@tykus,,

I got the URL. But it's giving me this Message in Postman:

"response": {
        "api_status": 0,
        "code": 400,
        "message": "Your HTTP method is not correct."
    }
nafeeur10's avatar

@tykus,

You are correct. But after hitting your given url it is showing me the above Response:

"response": {
        "api_status": 0,
        "code": 400,
        "message": "Your HTTP method is not correct."
    }
aurawindsurfing's avatar

Have a look at your postman on your screenshot your url is missing one dot:

https://127.0.01:8000/api/data/stripeKeyStore

should be

https://127.0.0.1:8000/api/data/stripeKeyStore

Forget postman for the moment, put this in your browser and see what you got. You should get response, if not then it is your application that is misconfigured.

For instance here is an API endpoint that works in both postman and browsers:

https://api.rollbar.com/api/1/status/ping

s4muel's avatar

127.0.01 shouldn't be a problem, but it is definitely worth checking.

but i wonder where does this: Your HTTP method is not correct come from? where do you have that code? it is not in laravel out of the box... search for this string in your whole project (including the vendor directory) and post here the related code and where it is.

Please or to participate in this conversation.