This is a sample application demonstrating Spring 5 Webflux framework with endpoints written in a functional style
./gradlew clean bootRun
Assuming that httpie is installed in your machine
http POST 'http://localhost:8080/messages' id="1" payload="one"
http POST 'http://localhost:8080/messages' id="2" payload="two"
http POST 'http://localhost:8080/messages' id="3" payload="three"
OR with CURL
curl -X "POST" "http://localhost:8080/messages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d $'{
"id": "1",
"payload": "one"
}'
curl -X "POST" "http://localhost:8080/messages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d $'{
"id": "2",
"payload": "two"
}'
curl -X "POST" "http://localhost:8080/messages" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d $'{
"id": "3",
"payload": "three"
}'
Get Messages
http GET 'http://localhost:8080/messages'
OR with Curl
curl -X "GET" "http://localhost:8080/messages" \
-H "Accept: application/json"
Get Message with an id
http GET 'http://localhost:8080/messages/1'
curl -X "GET" "http://localhost:8080/messages/1" \
-H "Accept: application/json"
Delete Messages by id
http DELETE 'http://localhost:8080/messages/2'
curl -X "DELETE" "http://localhost:8080/messages/2" -H "Accept: application/json"