Hi,

I would like to create a HTTP Action notification and send postdata with it. I already know it can be done in Notifications -> Add new notification -> select Execute HTTP Action. In the URL I put my own site that will retrieve the Postdata given. The postdata in this case will be only the placeholder %message.

My question is how can I retrieve the Postdata that I put in before with vb.net.

Thanks in advance!


Article Comments

Asuming you have put

message=%message

in the sensor's post data field, you can retreive this value in VB (ASP.NET) with the code snippet below. (to be placed in the page load event.)

Dim param() As Byte = Request.BinaryRead(HttpContext.Current.Request.ContentLength)
Dim content As String = Encoding.ASCII.GetString(param)
Dim args As NameValueCollection = HttpUtility.ParseQueryString(content)
Dim myMessage as string = args("message")

Aug, 2014 - Permalink

How could I test this? With dummy data? Like message=test

Thanks


Aug, 2014 - Permalink

You can use the notification test button to test the notification. When testing, placeholders are send as plain text, so in the example above you would expect to get '%message' in your myMessage variable.


Aug, 2014 - Permalink

Thanks al ot! It works now. Really helped me!


Aug, 2014 - Permalink