Skip to content

POST Error message has "NULL" in fields #5

@dijkstra1930

Description

@dijkstra1930

I ran a simple test with an error in the JSON post. Compare the POST with "ID" vs "DEVICE_ID:

url= http://einstein/sensors json= {"id": "test1", "timestamp":200000, "junk1": "100", "junk2": "200"} r= saved

url= http://einstein/lastest_readings_from_all_devices/junk1/json r.text= [{"timestamp":200000,"sensor_type":"junk1","value":0,"device_id":"test1"},,{"timestamp":300000,"sensor_type":"junk1","value":0,"device_id":"test2"}]

Note that I put the sensor values as strings, rather than integers. It doesnt convert, doesnt complain, just posts 0

url= http://einstein/sensors json= {"device_id": "test3", "timestamp":200000, "junk1": "100", "junk2": "200"} r= some not saved: [device_id, null, 200000, 0.0
, junk1, null, 200000, 0.0
, junk2, null, 200000, 0.0
]

What are all those NULL fields

url= http://einstein/lastest_readings_from_all_devices/junk1/json r.text= [{"timestamp":200000,"sensor_type":"junk1","value":0,"device_id":"test1"},{"timestamp":300000,"sensor_type":"junk1","value":0,"device_id":"test2"}]

and Test3, test 4 dont make it in. -- probabaly OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions