0

Proper PUT formatting for AIO
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Proper PUT formatting for AIO

by hepaestus on Sat May 07, 2016 7:03 am

I am trying to PUT my data to Adafriut IO but I keep getting an "HTTP/1.0 400 Bad request" error.
Here is the format I am trying to use:
Code: Select all | TOGGLE FULL SIZE
    PUT /hepaestus/feeds/temperature_f.json HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip,deflate
    Content-Type: application/json
    x-aio-key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Accept Language: en-us
 {"last_number": "47.80"}

Is there something wrong with my PUT format or my url?
Thanks,
P.

hepaestus
 
Posts: 40
Joined: Sat May 07, 2016 6:54 am

Re: Proper PUT formatting for AIO

by jwcooper on Mon May 09, 2016 12:11 pm

What is last_number?

last_value is an auto-generated field created by the system as a helper for you. We're actually removing it soon.

This is the best way to create data for your feed:
https://io.adafruit.com/api/docs/#!/Data/send

jwcooper
 
Posts: 756
Joined: Tue May 01, 2012 9:08 pm

Please be positive and constructive with your questions and comments.