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.
In order to configure and deploy this Channel, you'll need the following:
The HTTP Channel has five main properties. This section will cover them all briefly.
The specific HTTP
Method you wish to use. Helium makes the following Methods available with this Channel:
Endpoint is the URL of the webservice with which your sensor data will be interacting over HTTP. Supply the full endpoint, including the leading
Supply HTTP headers as needed with your request per the specification of your target webservice. Commonly-used headers include
Authorization. There is no limit to the number of headers you can supply via the Helium HTTP Channel.
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).
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
Arduino environments is are provided by default.
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:
When logged in to Dashboard, head to the Channels interface and click on
HTTP under the available options.
Next, supply the following text in the fields provided.
Endpointabove with the new RequestBin URL you created to complete this demo.
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:
Let's name this Channel
json-to-requestbin-demo. Once you've added it to the provided text box, click Save.
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.
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.)