Home > Blockchain >  How to add a String in the method findById in Postman?
How to add a String in the method findById in Postman?

Time:03-22

I have this problem that I show you in the picture

How I can add a string in the request?

This is my method in SpringBoot

This is the error

I edit the question to show this important picture. This is my table and "matricula" is a String and it is my ID

I need help to know how I can to add a String ID in the Postman request.

Thank you. Sorry for my English level.

Greetings.

CodePudding user response:

For path /resource/{variableName}, the variableName must be same as the method parameter name or same as the alias in @PathVariable("variableName").

In your case, just change the mapping to @GetMapping("/coches/{matricula}"). And you should not use "" in request path. Request with /api/coches/1234ABC instead.

  • Related