O'Reilly logo

Getting Started with the Internet of Things by Cuno Pfister

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What Netduino Said to Pachube

To see that there is no magic involved in HTTP requests, let’s look at the data actually transferred to the Pachube server during a request:

PUT /v2/feeds/fid.csv HTTP/1.1\r\n
Host: api.pachube.com\r\n
X-PachubeApiKey: your Pachube API key is here\r\n
Content-Type: text/csv\r\n
Content-Length: 12\r\n
\r\n
voltage,1.52

This is the text sent over the Internet to Pachube! At least that’s what is sent if the measured voltage is 1.52.

An HTTP request consists of one request line, followed by a number of header lines, followed by an empty line, and optionally followed by a message body (i.e., the message’s content).

The request line starts with the HTTP method: PUT, GET, etc. After a blank, the request URI indicates the resource ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required