404 not found error occurs while performing the api test

Hi,
I’m currently doing API testing and I keep getting 404 not found errors.

@RestController
@RequestMapping(value = "/api")
public class ApiCommonController {

@RequestMapping(value = "/get/postmantest", method = {RequestMethod.GET})

    public String GetMappingTest (@RequestParam int id) {

        return "Get Mapping : " + id;
    }

I sent a request to an endpoint address such as http://localhost:7771/api/get/postmantest?id=15 using Get, but I get a 404 not found error

I don’t think there’s a typo in the endpoint address, but I don’t know what the problem is.

I’d like some advice

Hey @navigation-observe19 :wave:

Welcome to the Postman community! :postman:

This is an implementation issue with your code around the correct route of the endpoint you’re trying to hit.

It’s returning a 404 so it’s hitting the server and then responding, it just couldn’t find anything at the route to specified.

I’m not familiar with that language so I couldn’t tell you what’s actually wrong, I might be worth creating a question on Stackoverflow to seek a more code centric response.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.