Taking It for a Ride
We'll cover the following
The commands to run
Let’s verify that all that code works well together. Once again, build the application and run the service. Use curl or any tool of your choice to exercise the application. Here’s a series of curl calls to exercise the service.
curl -w "\n" -X GET http://localhost:8080/task
echo ""
curl -w "\n" -X POST \
-H "Content-Type: application/json" \
-d '{"description": "write code"}' http://localhost:8080/task
curl -w "\n" -X POST \
-H "Content-Type: application/json" \
-d '{"description": "test"}' http://localhost:8080/task
echo ""
curl -w "\n" -X GET http://localhost:8080/task
echo ""
curl -w "\n" -X DELETE http://localhost:8080/task/1
curl -w "\n" -X DELETE http://localhost:8080/task/10
echo ""
curl -w "\n" -X GET http://localhost:8080/task
Running the application
Click the RUN button below and the application will start. Once the application starts successfully and creates a connection with the local host, click the +(plus) button beside the terminal. A new terminal would open for you to test run the above commands.
Get hands-on with 1400+ tech skills courses.