I created HTTP Push Data Advanced sensor with HTTP Request Method = POST I use Postman to test sending the HTTP POST to http://<my_prtg_ip>:5050/<token>
Test 1:
If I use the following POST content, I received error: No response (code: PE002) in PRTG
{ "prtg": { "result": [ { "channel": "MyChannel", "value": "12" } ], "text": "Breaking news 2" } }
Test 2:
If I use the following POST content (notice "content=" in 1st line), PRTG can receive successfully
content= { "prtg": { "result": [ { "channel": "MyChannel", "value": "12" } ], "text": "Breaking news 2" } }
Test 3:
If I use the following POST content, I received error: No response (code: PE002) in PRTG
{<prtg> <result> <channel>MyChannel</channel> <value>10</value> </result> <text>Mary%20has%20a%20little%20dove</text> </prtg>
Test 4:
If I use the following POST content(notice "content=" in 1st line), PRTG can receive successfully
content= <prtg> <result> <channel>MyChannel</channel> <value>10</value> </result> <text>Mary%20has%20a%20little%20dove</text> </prtg>
- Question: Is this a bug?
Article Comments
I finally found the solution (or workaround) so that "content=" is not necessary in the HTTP POST.
Test 1 in my example above works with the HTTP POST body as shown IF I add content type application/json.
May, 2017 - Permalink
Hi there,
Nice, thanks for sharing!
Regards,
Stephan Linke, Paessler Tech Support
May, 2017 - Permalink
Hi there,
It's not a bug. PRTG always checks the content of the content post field, which is empty by default when omitting it. You're just submitting the result without a key for PRTG to associate with the result.
Regards,
Stephan Linke, Paessler Tech Support
May, 2017 - Permalink