This server also supports experimental data ingest. If the server configuration at HAPI_HOME/keys/ contains a key for a data product, then this allows post requests to insert data into the server. For example, the scientist if digitizing data and this allows the data to be stored in a common location.

A multipart upload is needed to push data. This should contain the firstly "key" which secures the server. This is a unique string known to the server implementation and to the client using it. (Presently this is an 8-digit number.) Second, the post contains the csv-formatted data in "data".

This Python code shows how to push data. Suppose you have a chicken coop with a Raspberry PI and a temperature sensor. We wish to regularly store the temperature of the chicken coop by pushing data into a HAPI server. Here is the Python code (after 'pip install requests'):

import requests 
data = {'key':'12345678', 
        'data':'2021-01-01T00:00Z,-4.4\n2021-01-01T01:00Z,-4.6\n'} 
r = requests.post(url = 'http://localhost:8084/HapiServerDemo/hapi/data?id=chickens', data = data)  
                
Note the server is able to get the key from the post part of the request.

wget can be used to insert a record as well:

wget --post-data='data=2002-02-02T00:00Z,4.56' 'http://localhost:8084/HapiServerDemo/hapi/data?id=chickens&key=12345678'
or to avoid having the key appear in server logs:
wget --post-data='key=12345678&data=2002-02-02T00:00Z,4.56' 'http://localhost:8084/HapiServerDemo/hapi/data?id=chickens'