Composing and sending HTTP requests

The HTTP server is running in Yocto Linux and waiting for our HTTP requests to control the LEDs on connected to the Intel Galileo Gen 2 board. Now, we will compose and send HTTP requests locally in Yocto Linux and then from other computer or devices connected to our LAN.

HTTPie supports curl-like shorthands for localhost. For example, :8888 is a shorthand that expands to http://localhost:8888. We already have an SSH terminal running the HTTP server, and therefore, we can run the following command in another SSH terminal.

http GET :8888/version

The previous command will compose and send the following HTTP request: GET http://localhost:8888/version. The request is the simplest case in our RESTful API because it ...

Get Internet of Things with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.