Leave a Reply

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

Notify of
avatar

MBadAtGuitar
Guest
MBadAtGuitar
8 days 13 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
20 days 3 hours 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
16 days 8 hours 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
1 month 16 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
1 month 16 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"}

David Carey
Guest
David Carey
13 days 11 hours ago

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

Peace
Guest
Peace
2 months 24 days ago

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

Peace
Guest
Peace
2 months 25 days ago
Can you please help. My post Method does not give me any result just like yours so that is fine but when i try to run get method it does not show the last id, name and description which i entered. So one part seems right but other part is not right.[ { "id": "Spring", "name": "Spring Framework", "description": "Spring Framework Description" }, { "id": "Java", "name": "Java Framework", "description": "Java Framework Description" }, { "id": "Java Script", "name": "JavaScript Framework", "description": "JavaScript Framework Description" }]Your videos helped me so much. Thanks
Peace
Guest
Peace
2 months 25 days ago

Can you help with this please? Upto topics is fine but the moment i enter an id i get this errror{ "timestamp": 1483577703511, "status": 404, "error": "Not Found", "message": "No message available", "path": "/topics/java"}

prakash mani
Guest
prakash mani
2 days 1 hour ago

Try Adding a blank constructor in your POJO.

wpDiscuz