Sending hand-crafted HTTP requests

Brunda K
Brunda’s Tech Notes
2 min readAug 2, 2023

--

While debugging HTTP issues, it sometimes becomes necessary to create HTTP requests manually/by-hand that can be then sent to the HTTP server to test/debug the server.

In this article, I would like to look at some tools that may help achieve this.

HTTPie

This is a command-line tool that allows one to craft HTTP requests and send them to a HTTP server.

When installed, this tool is available as http and https. If you would like to send a HTTP request, you could use http. If you would like to send a HTTPS request, you could use the command https.

Here are some examples of using http

#Uses GET method to obtain index.html from Server running at localhost:8080
http GET localhost:8080/index.html

#Sets certain headers before requesting for /index.html
http GET localhost:8080/index.html Cookie:foo=bar User-Agent:MyUA

#To see the request headers as they are being sent, use -v.
http -v

The second tool which is very versatile and offers a host of options is the Advanced Rest Client.

Advanced Rest Client tool

This is an application that can be installed on your machine. It is available at https://github.com/advanced-rest-client/arc-electron/releases.

An excellent video about How To Use this tool is available on Youtube here

Conclusion

Httpie and Advanced Rest Client could be two tools that may come in handy when debugging HTTP issues that requires crafting and sending a HTTP request to the server.

--

--