Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 597 Bytes

File metadata and controls

12 lines (8 loc) · 597 Bytes

https://www.javacodegeeks.com/2013/07/spring-mvc-requestbody-and-responsebody-demystified.html

I think Spring comes default with XML and JSON converter. Here in the basic Spring Boot Application we have create a custom converter for text/csv mime type

  1. start server mvn spring-boot:run

  2. curl -X PUT --header "Content-Type: text/csv" localhost:8080/bookcase -d '"123","Spring in Action"' curl -X PUT --header "Content-Type: text/csv" localhost:8080/bookcase -d $'"123","Spring in Action"\n"1234","Hello World"'

  3. curl -X GET --header "Content-Type: text/csv" localhost:8080/bookcase