# Http .post not sending data

**URL:** <https://community.influxdata.com/t/http-post-not-sending-data/8326>\
**Category:** Kapacitor\
**Tags:** kapacitor\
**Created:** [January 28, 2019, 3:45pm UTC](https://community.influxdata.com/t/http-post-not-sending-data/8326 "2019-01-28T15:45:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_Ewah-Uche](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@George\_Ewah-Uche](https://community.influxdata.com/u/George_Ewah-Uche)\
**Post date:** [January 28, 2019, 3:45pm UTC](https://community.influxdata.com/t/http-post-not-sending-data/8326/1 "2019-01-28T15:45:28Z")

</div>

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](https://stackoverflow.com/questions/46408175/kapacitor-post-http-post-to-url-not-sending-data) but the answer is not relevant to me.

---

<div class="post-metadata">

**Author:** ![George\_Ewah-Uche](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@George\_Ewah-Uche](https://community.influxdata.com/u/George_Ewah-Uche)\
**Post date:** [January 28, 2019, 4:27pm UTC](https://community.influxdata.com/t/http-post-not-sending-data/8326/2 "2019-01-28T16:27:47Z")

</div>

> [@George\_Ewah-Uche](#):
>
> [influxdb - Kapacitor .post() HTTP Post to url not sending data - Stack Overflow](https://stackoverflow.com/questions/46408175/kapacitor-post-http-post-to-url-not-sending-data)

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](https://github.com/influxdata/kapacitor/issues/1681)
