I am using Drupal as a backend to deliver data, collected using sensors, and stored in the Drupal database to a mobile app that present the data to the end user.
Drupal records the value from a temperature sensor. When some event happens that changes the temperature, the value is stored in a temperature field in a standard node. I then need to wrap the temperature and use a POST endpoint (defined by an external app) to notify the app about the temperature recorded (i.e. a push notification or export of data by means of POST).
I know how to do this with GET (which requires the app to poll the endpoint periodically to check if a new data point is available), but I need to do this by means of POST from the the Drupal back end whenever a new data point is created.
I believe I shall be able to implement
hook_ENTITY_TYPE_insert()to intercept the node when it is being created to save the new data. What I am struggling with is how to use POST to push the data to the app.