Grokking Spring Boot
0% completed
Controllers and Request Mapping
When Ana books seat A12, what should the booking service send back? A body with the new booking is the obvious part. The status code and the headers matter as much, because the app reads them before it reads the body.
This is what the finished endpoint returned in our run:
HTTP/1.1 201 Location: /bookings/1 Content-Type: application/json {"id":1,"eventId":7,"seatLabel":"A12","status":"CONFIRMED"}
The status 201 says that something new was created, and the Location header gives its path
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%