Leave a Reply

20 Comments on "Spring Boot Quick Start 19 – Creating a new resource using POST"

Notify of
avatar

Diego De Souza
Guest
Diego De Souza
14 days 12 hours ago

Quick question, the method `add()` on the to "topics" List<>, where is that from? is it a Spring Boot method? Java? is it like push() in Javascript?

Vishwanath Gajavelly
Guest
Vishwanath Gajavelly
13 days 22 hours ago

collections !

Faris Hammoud
Guest
Faris Hammoud
14 days 16 hours ago

You can also use the convenience annotations "@GetMapping, @PostMapping, @PutMapping and @DeleteMapping".

Faris Hammoud
Guest
Faris Hammoud
13 days 21 hours ago

Yes, using version 4.3.6. I don't know at what version they were made available, but I used them as I was following along with this tutorial and they worked as expected.

Vishwanath Gajavelly
Guest
Vishwanath Gajavelly
13 days 21 hours ago

hi Faris, did you try this out ? Thanks

Stefano Mavilio
Guest
Stefano Mavilio
19 days 4 hours ago

Spring Boot Hero. Thx!

Dez S
Guest
Dez S
29 days 7 hours ago

Thank you very much for the lesson sir! From Singapore 🙂

Abhimanyu Sharma
Guest
Abhimanyu Sharma
1 month 14 days ago

Hi, how do you get the properties menu to pop-out at 1:25?

Abhimanyu Sharma
Guest
Abhimanyu Sharma
1 month 14 days ago

got it in the view.. "Ctrl+Space"

MBadAtGuitar
Guest
MBadAtGuitar
2 months 11 hours ago

Great tutorials..Thanks Koushik for spreading the knowledge.One question regarding the Content type.Instead of setting the content type to the header while sending a request in POSTMAN, cant we just annotate the method addTopic like :@Consumes(MediaType.APPLICATION_JSON)@Produces(MediaType.APPLICATION_JSON)Will appreciate if anyone can reply. Thanks

Sainath Pabba
Guest
Sainath Pabba
2 months 12 days ago

thanks,tutorials are very helpful for beginners.but I have one doubt. the data is saving where ? when we are adding a new topic in the postman hitting with post request?

Chris Hill
Guest
Chris Hill
2 months 8 days ago

Its saving in state, saving in memory. the list has been initialised with 3 entries. when the application is running, and you perform a 'add' to that list, it adds it in memory (4 items). When the application stops, the list is now – in code 3 items

Kumar Reddy
Guest
Kumar Reddy
3 months 8 days ago

I was able to figure out the issue , I am giving the request body as [{ "id": "struts", "name": "Struts MVC Framework", "description": "Struts MVC Framework Description" }]I removed [ ] , it worked. Thanks again for wonderful tutorial.

Kumar Reddy
Guest
Kumar Reddy
3 months 8 days ago

Hi Koushik,Thanks for the tutorial, It is really helpful. I have an issue with POST. I am getting the following error. Please help me to understand what is going wrong here.{ "timestamp": 1487050810326, "status": 400, "error": "Bad Request", "exception": "org.springframework.http.converter.HttpMessageNotReadableException", "message": "Could not read document: Can not deserialize instance of io.javabrains.springbootstarter.topic.Topic out of START_ARRAY tokenn at [Source: java.io.PushbackInputStream@15ae833; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of io.javabrains.springbootstarter.topic.Topic out of START_ARRAY tokenn at [Source: java.io.PushbackInputStream@15ae833; line: 1, column: 1]", "path": "/topics"}

Kumar Reddy
Guest
Kumar Reddy
1 month 19 days ago

I was able to figure out the issue , I am giving the request body as [{ "id": "struts", "name": "Struts MVC Framework", "description": "Struts MVC Framework Description" }]I removed [ ] , it worked. Thanks again for wonderful tutorial.

David Carey
Guest
David Carey
2 months 5 days ago

Same Problem Im getting 500 internal server error did you find a solution??

Peace
Guest
Peace
4 months 15 days ago

I was able to figure it out. Thanks anyways. You can ignore my questions now.

wpDiscuz