Testing the HTTP server using CURL and POSTMAN
CURL
is a command-line tool that is portable across Windows, GNU Linux, MacOS, and other POSIX compliant systems. The tool helps to transfer data using various TCP/IP-based application protocols. Some of the common protocols supported include HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, and LDAP,to name a few.
We will be using the CURL
tool to test the HTTP server we wrote. The command-line utility can be invoked by giving the requisite command-line parameters to place HTTP requests with associated verbs. We give the command-line parameters for invoking the GET
and the PUT
request to the server we wrote:
curl -X PUT http://localhost:34567/DBDEMO/ -H "Content-Type: application/json" -d '{"SimpleContent":"Value"}'curl -X GET -H "Content-Type: application/json" http://localhost:34567/DBDEMO/
Embed the previous command in a batch file or shell script, depending upon your platform. The output on the console should...