HTTP Icon

Helium HTTP Channel


Use Helium’s HTTP Channel to interact with a target webservice or application over HTTP. When deployed, this Channel will perform the selected action (see the list of supported Methods below) on the user's behalf in near-real time. Nearly all webservices accept data over HTTP, making this Channel extremely versatile for prototyping and scaling out your sensing applications.


Channel Prerequisites

In order to configure and deploy this Channel, you'll need the following:

HTTP Channel Properties

The HTTP Channel has five main properties. This section will cover them all briefly.

HTTP Method

The specific HTTP Method you wish to use. Helium makes the following Methods available with this Channel:

Endpoint

The Endpoint is the URL of the webservice with which your sensor data will be interacting over HTTP. Supply the full endpoint, including the leading http:// or https://.

HTTP Headers

Supply HTTP headers as needed with your request per the specification of your target webservice. Commonly-used headers include Content-Type, Content-Length, and Authorization. There is no limit to the number of headers you can supply via the Helium HTTP Channel.

Channel Name

The Channel Name is the unique name you give to a Channel. You'll also use this name to identify this channel in your device's code (which we'll cover in a moment).

HTTP Channel Code

Lastly you need to configure the Atom to send data to the newly-created channel. Helium Dashboard will autogenerate the code you'll need to upload to your device. Code snippets for Raspberry Pi, ARM mbed, and Arduino environments is are provided by default.

Example: Sending JSON Data over HTTP to RequestBin

Here's a complete example of how to use a Helium HTTP Channel to POST JSON data to RequestBin. (RequestBin is a great way to test HTTP requests for free.). Here's how it works end to end:

Step 1: Create New Channel

When logged in to Dashboard, head to the Channels interface and click on HTTP under the available options.

Step 2: Supply Methods and Endpoints

Next, supply the following text in the fields provided.

Step 3: Supply Headers

In this example we'll be sending your device data as JSON. As such, we need to tell RequestBin what type of data to expect. To do this, use the following Header details:

Step 4: Name Channel

Let's name this Channel json-to-requestbin-demo. Once you've added it to the provided text box, click Save.

Step 5: Deploy Channel Code to the Atom

After you've named and saved your Channel, Helium will generate the code you need to copy and paste onto your device. Copy the code for your board type and upload it to your local environment.

Step 6: View Your Data

After you've deployed the channel code to the target device, you'll be sending data that Channel and onto RequestBin. To inspect data sent to a RequestBin URL, simple append ?inspect to the url and visit that page in a browser. For example, here we're using the endpoint https://requestb.in/1ki88sz1 from RequestBin to accept our JSON data. So, to inspect this data, you would simply head to https://requestb.in/1ki88sz1?inspect. (Note that this specific RequestBin URL won't work as they expire fairly quickly.)

Get Support