Http .post not sending data

Ok I have been making some baby steps as I would like to use influxdb and kapacitor for a project I am working on. However I can’t figure or even hack my way around .post returning an empty array.

These are my scripts:

dbrp "TEST_MEASUREMENTS"."autogen"

batch
	|query('''
		SELECT mean(data)
		FROM "TEST_MEASUREMENTS"."autogen"."temperature"
		WHERE processed != true
	''')
		.period(5h)
		.every(1m)
		.groupBy('my_id')
	|alert()
		.crit(lambda: "mean" > 30)
		.message('observableName: {{.Name}} mean: {{index .Fields "mean"}} myId: {{index .Tags "my_id"}}')
		.post('http://localhost/api/post-alerts')
		.log('/tmp/alert_temp')

This triggers the alert and is logged but the post parameters are empty. This is a php script I try to use to extract it:

$data = $this->params()->fromPost();
error_log("Data: $data");

The array returned is empty. Though it logs correctly. This is a similar problem to what I have: influxdb - Kapacitor .post() HTTP Post to url not sending data - Stack Overflow but the answer is not relevant to me.

I found the solution to the problem for anyone facing a similar issue.

header(‘Content-Type: application/json’);
$data = json_decode(file_get_contents(‘php://input’),true);

Your message details will be in $data. I got this here: is it possable to send post data using alert(http post)? · Issue #1681 · influxdata/kapacitor · GitHub