Testing Endpoints with Postman
We can test GET endpoints directly in the browser.

- We can also
POSTwith an HTML form, but other HTTP methods require JavaScript to execute.
Another tool for interacting with a server is curl, a command-line client for requesting URLs.
curl -X GET http://localhost:8080/ping
pong
curlcan execute any HTTP request method, reading request body content from a file or the command line, allows setting of request headers and many other options, and works with a wide variety of protocols.
Postman¶
Postman is a graphical development environment for testing web APIs.

With Postman you can: * Execute any HTTP request. * Send request bodies in a variety of formats. * Set request headers. * Provide authentication credentials for secured APIs. * Create and reuse collections of tests for different APIs.
Drill¶
-
Launch your program and hit
http://localhost:8080/pingwith your browser. -
Download and install the Postman app from https://www.getpostman.com/.
-
Hit
http://localhost:8080/pingwith the Postman tool. You should receive a string response ofpong.