The HyperText Transfer Protocol (HTTP) is a client-server protocol powering most of the internet. Every time you surf the web, your browser sends HTTP requests for HTML pages, images, scripts, and style sheets. Web servers handle these requests by returning responses containing the requested resource, thus completing the HTTP request-response cycle.
![](https://res.cloudinary.com/di2vaxvhl/image/upload/v1545849277/HTTP_txch7g.png)
In the same way your browser or smartphone interact with the web through HTTP requests, IoT devices also make HTTP requests to external servers to get their data online. In this guide, we’ll describe some available tools to simulate an HTTP request from a client to a server.
HTTP is one of the IoT protocols supported by Ubidots, a platform where you can rapidly assemble and launch IoT applications without having to write code or hire a software development team. Hopefully, this guide will help you test your IoT communication before coding your device. Let’s get started! 🙂
Tools to Simulate HTTP Requests
There are hundreds of tools available for generating HTTP requests, but this guide will focus on the top 3 we’ve found to be the most reliable. It’s important to note that there’s a wide variety of tools out there for generating HTTP responses, including:
- Online tools
- Desktop tools
- Browser tools
- Browser add-ons
- Request-as-a-Service tools
The most common type is online request tools, which are easy to use and produce a clean output. But they’re not necessarily the best – they’re limited to basic HTTP requests and so cannot run scripts, generate reports, or create web socket connections. Nevertheless, as the most common HTTP request tools, we felt best to give an overview before getting more specific.
The Top Three
In writing this post, I asked the Ubidots Development Team which tools for generating HTTP requests are most commonly used on a daily basis. Comparing their answers, we arrived at these #Top 3:
1. Postman
Postman is a complete toolchain for API development. You can get Postman as a Chrome extension, or download the app here. Postman is open source on Mac, Windows, and Linux.
Designed to support all aspects of API development from the ground up, Postman’s apps are built on a single underlying layer to ensure consistent performance and user experience. Postman also mirrors your existing API development workflow, with run, test, document & monitor features designed to seamlessly make your current workflow quick, concise, and easy.
2. Insomnia
Insomnia is a powerful HTTP tool belt in one intuitive app. You can get Insomnia as a Chrome extension, or download the app here. Insomnia REST client is free and open source on Mac, Windows, and Linux.
With Insomnia, you can create HTTP requests and specify URLs, payloads, headers, and authorizations all in one place. You can view the entire transaction, get details on every response, view the status code, body, create workspaces or folders, drag-and-drop requests, and easily import and export your data.
Below you can find a quick example of how to handle an HTTP request with Ubidots to start sending data using Insomnia. To do this you must have a Ubidots account (sign up for a free one here) and Insomnia already downloaded.
In Insomnia, type in the following information and press “CTRL + Enter” to send the request:
- Method: POST
- Body: JSON - {"my-variable": 50.71}
- URL: https://industrial.api.ubidots.com/api/v1.6/devices/my-device
- Header: X-Auth-Token / Your Ubidots Token
You can learn more about tokens here. Refer to the GIF below for a better understanding of the request:
![](https://ubidots.com/blog/content/images/2019/11/insomnia_ubidots.gif)
3. Advanced
Advanced REST client, or ARC, allows for more advanced debugging. It’s available as a Chrome extension, or for download here.
Like Postman, ARC lets you build a request by providing the request type and URL. But it also lets you implement custom request types, enter raw headers, and define custom parameter strings. You can group multiple requests under a single project, store requests in Google Drive, and view your request history.
In addition to HTTP requests, Advanced REST Client also supports WebSocket connections. On the left-hand menu, select “Socket” and enter the URL of the WebSocket server. If the connection is successful, you can transmit messages to and from the server effortlessly.
Results
Now that you know a bit more about the most common tools used to test HTTP requests, choose one that best fits your needs and start your client-server communication today. Don't forget to share this blog post with fellow developers and visit the community for more IoT awesomeness. Until then, happy tinkering!