Skip to content
Advertisement

Spring boot CLI client consuming Rest Api

I have build a rest API that works.

Now I try to buid a CLI client using spring boot but I have difficulties.

I think it’s because I am not using the RestTemplate correctly ?

I build a CLI client and I have errors for every request ; if I want to use the delete method for exemple, I use this line :

JavaScript

here is the main class

JavaScript

here is the PrisonerResource class :

JavaScript
JavaScript

Advertisement

Answer

your URI is malformed here: "http//localhost/api/v1/prisoners" you are missing a : for a correct URI: "http://localhost/api/v1/prisoners".

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement