Skip to content

Tag: rest

POST: Exception Status expected: but was:

Technically it should be a simple task, but I can’t find the error. I want to write a normal “POST method”, but when I tested it, it came to a problem: enter code here Status expected:<201> but what:<200>. My question is, why do I get an OK and not a CREATED? CODE: PostMapping in…

Make a POST with JPA with existing data

I have the following problem, the thing is that I have an entity: The thing is that this back is connected to an Oracle DB, in which I already have a few registered users, but these are entered through a Mockaroo script, and when I try to save a new user through a service Rest throws me this error: Of

Java Rest API – Method to return balance on account [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question I need to get the balance for a particular customer id and account id. I…

Developing multiple springboot services in an IDE

How can you develop and test multiple REST services developed in Springboot from an IDE? I will have to have different port numbers for each REST service, is there any better way? Answer First of all you’ll probably want to show all the source files from all the services in the same IntelliJ project. So…

No response on a GET query to JAX-RS service

I have a service that has two classes and is very simple: and Commented lines are the ones that I tried to use. Every time I call “http://localhost:8080/api/hello-world” or “http://localhost:8080/api” the response is 404-Not Found. I use Tomcat 9.0.50. What can be wrong with my usage o…