https://github.com/jonathan-foucher/spring-boot-csv-api-example
An example of HTTP API consuming and producing CSV files with spring-boot
https://github.com/jonathan-foucher/spring-boot-csv-api-example
csv-export csv-import jackson-dataformat-csv java spring-boot
Last synced: 11 days ago
JSON representation
An example of HTTP API consuming and producing CSV files with spring-boot
- Host: GitHub
- URL: https://github.com/jonathan-foucher/spring-boot-csv-api-example
- Owner: jonathan-foucher
- Created: 2025-03-07T17:05:37.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-09T22:58:32.000Z (about 1 year ago)
- Last Synced: 2025-12-29T01:47:43.610Z (5 months ago)
- Topics: csv-export, csv-import, jackson-dataformat-csv, java, spring-boot
- Language: Java
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
This project is an example of a HTTP API consuming and producing CSV files with Spring Boot.
## Run the project
### Database
Install postgres locally or run it through docker with :
```
docker run -p 5432:5432 -e POSTGRES_DB=movie_db -e POSTGRES_USER=user -e POSTGRES_PASSWORD=user postgres
```
### Application
Once the postgres database has started, you can launch the Spring Boot project and try it out.
Get all movies as CSV
```
curl --request GET \
--url http://localhost:8090/csv-api-example/movies
```
Create movies from CSV
```
curl --request POST \
--url http://localhost:8090/csv-api-example/movies \
--header 'content-type: text/csv' \
--data 'id,title,release_date
,"Some movie",2022-02-22
,"Some other movie",2022-02-23
,"Some third movie",2018-12-14
'
```