Skip to content

bulbulpaul/springboot-ndjson-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringBoot ndjson example

Example code of allow ndjson request to Spring MVC.

request example

use example file of data/example.ndjson

$ cat data/example.ndjson                                                                                                                 
{ "id": "test_1", "name": "Work", "priority": 1 }
{ "id": "test_2", "name": "Todo", "priority": 2 }

$ curl -i -X POST "http://localhost:8080/bulk" -H "accept: */*" -H "Content-Type: application/x-ndjson" --data-binary @data/example.ndjson
HTTP/1.1 201 
Content-Type: application/x-ndjson
Content-Length: 85
Date: Wed, 01 Jul 2020 23:54:48 GMT

$ curl -i -X GET "http://localhost:8080/todos"                                                                                        
 HTTP/1.1 200 
 Content-Type: application/x-ndjson
 Content-Length: 85
 Date: Thu, 02 Jul 2020 00:44:50 GMT
 
 {"id":"test_1","name":"Work","priority":1}
 {"id":"test_2","name":"Todo","priority":2}

LICENSE

MIT

About

Example code of allow ndjson request to Spring MVC.

Resources

Stars

Watchers

Forks

Languages