HTTP Receiver
-
Hello guys, could someone explain to me how to set the "HTTP Receiver" step by step? I read several posts in the forum and the guide that appears by clicking "?" but I have no idea where to start ...
In practice I should do a POST to the DataSource. I tried to ping it but without success.
Thanks ;) -
Hi pierjsap,
Did you happen to come across this thread? https://forum.infiniteautomation.com/topic/2187/how-to-use-publishers-http-sender
I provide examples of the format sent by the HTTP publisher (which is made to work with the HTTP receiver)
Here's some JSON for a publisher publishing a point with the XID 'brown' (a virtual numeric brownian point) to a receiver on the same system.
{ "dataSources":[ { "xid":"DS_bef627bf-962c-42f2-94aa-88ea3e1a5cd2", "name":"http rec", "enabled":true, "type":"HTTP_RECEIVER", "alarmLevels":{ "SET_POINT_FAILURE":"URGENT" }, "purgeType":"YEARS", "setType":"PUBLISHER", "dateFormat":"DATE_FORMAT_BASIC", "deviceIdWhiteList":[ "*" ], "ipWhiteList":[ "*.*.*.*" ], "setPointUrl":"", "editPermission":"", "purgeOverride":false, "purgePeriod":1 }, { "xid":"DS_9a8d6d68-d97e-4e20-8de0-7ef8afa905d7", "name":"virt data", "enabled":true, "type":"VIRTUAL", "alarmLevels":{ "POLL_ABORTED":"URGENT" }, "purgeType":"YEARS", "updatePeriodType":"SECONDS", "polling":true, "updatePeriods":5, "editPermission":"", "purgeOverride":false, "purgePeriod":1 } ], "dataPoints":[ { "xid":"brown", "name":"brown", "enabled":true, "loggingType":"ALL", "intervalLoggingPeriodType":"MINUTES", "intervalLoggingType":"AVERAGE", "purgeType":"YEARS", "pointLocator":{ "dataType":"NUMERIC", "changeType":{ "type":"BROWNIAN", "max":100.0, "maxChange":10.0, "min":0.0, "startValue":"50" }, "settable":true }, "eventDetectors":[ { "type":"POINT_CHANGE", "sourceType":"DATA_POINT", "xid":"ED_187d0e9c-7472-402d-92d2-806ad3af8404", "name":"liarsssssssssss", "alarmLevel":"NONE" } ], "plotType":"SPLINE", "rollup":"NONE", "unit":"", "simplifyType":"NONE", "chartColour":"", "chartRenderer":{ "type":"IMAGE", "timePeriodType":"DAYS", "numberOfPeriods":1 }, "dataSourceXid":"DS_9a8d6d68-d97e-4e20-8de0-7ef8afa905d7", "defaultCacheSize":1, "deviceName":"virt data", "discardExtremeValues":false, "discardHighLimit":1.7976931348623157E308, "discardLowLimit":-1.7976931348623157E308, "intervalLoggingPeriod":1, "intervalLoggingSampleWindowSize":0, "overrideIntervalLoggingSamples":false, "preventSetExtremeValues":false, "purgeOverride":false, "purgePeriod":1, "readPermission":"", "setExtremeHighLimit":1.7976931348623157E308, "setExtremeLowLimit":-1.7976931348623157E308, "setPermission":"", "tags":{ }, "textRenderer":{ "type":"ANALOG", "useUnitAsSuffix":true, "unit":"", "renderedUnit":"", "format":"0.00" }, "tolerance":0.0 }, { "xid":"DP_e3af996c-99e2-44df-b9ed-0f272cc889b7", "name":"point", "enabled":true, "loggingType":"INTERVAL", "intervalLoggingPeriodType":"MINUTES", "intervalLoggingType":"AVERAGE", "purgeType":"YEARS", "pointLocator":{ "dataType":"NUMERIC", "binary0Value":"", "includeTimestamp":true, "parameterName":"point", "setPointName":"", "settable":false }, "eventDetectors":[ ], "plotType":"SPLINE", "rollup":"NONE", "unit":"", "templateXid":"Numeric_Default", "simplifyType":"NONE", "chartColour":"", "chartRenderer":{ "type":"IMAGE", "timePeriodType":"DAYS", "numberOfPeriods":1 }, "dataSourceXid":"DS_bef627bf-962c-42f2-94aa-88ea3e1a5cd2", "defaultCacheSize":1, "deviceName":"http rec", "discardExtremeValues":false, "discardHighLimit":1.7976931348623157E308, "discardLowLimit":-1.7976931348623157E308, "intervalLoggingPeriod":1, "intervalLoggingSampleWindowSize":0, "overrideIntervalLoggingSamples":false, "preventSetExtremeValues":false, "purgeOverride":false, "purgePeriod":1, "readPermission":"", "setExtremeHighLimit":1.7976931348623157E308, "setExtremeLowLimit":-1.7976931348623157E308, "setPermission":"", "tags":{ }, "textRenderer":{ "type":"ANALOG", "useUnitAsSuffix":true, "unit":"", "renderedUnit":"", "format":"0.00" }, "tolerance":0.0 } ], "publishers":[ { "xid":"PUB_d13c8517-57eb-466e-ad4a-0f974da7846e", "name":"localsender", "enabled":true, "type":"HTTP_SENDER", "points":[ { "dataPointId":"brown", "includeTimestamp":true, "parameterName":"point" } ], "snapshotSendPeriodType":"MINUTES", "publishType":"ALL", "alarmLevels":{ "POINT_DISABLED_EVENT":"URGENT", "RESULT_WARNINGS_EVENT":"URGENT", "SEND_EXCEPTION_EVENT":"URGENT", "QUEUE_SIZE_WARNING_EVENT":"URGENT" }, "dateFormat":"DATE_FORMAT_BASIC", "raiseResultWarning":true, "staticHeaders":[ ], "staticParameters":[ ], "url":"http:\/\/127.0.0.1:8080\/httpds", "useJSON":false, "usePost":false, "cacheDiscardSize":1000, "cacheWarningSize":100, "sendSnapshot":false, "snapshotSendPeriods":5 } ] }
I did just fix a bug with importing the HTTP receiver, so you may have to create that data source using the UI if the import fails.
-
@phildunlap thanks for helping me. The DS http works. At this point I can not understand how to set the value of "HTTP parameter name" through a "post" request of an windows application outside of Mango.
I guess I have to check the settable for the datapoint. What is meant by the "Set point name"?"Requests are delivered using normal HTTP parameterized request formats. When using the GET method, the format is 'http: // localhost: 8080 / httpds? Point = 1'". I tried to call this Mango with Fiddler, but the value is not set to 1.
HTTP Receiver "Set point name"
Does it have anything to do with what I have to do? or did I misunderstand something?
-
You're very close! Things to check,
- point is lowercase in your HTTP parameter name setting, but capitalized Point in your URL
- The spaces in the URL are not desirable, but, you were probably doing that for the sake of the forum post formatting, which I appreciate.
and the real insight...
3. "localhost" is probably resolving to::1
for sake of your network traffic. There is a known issue with the HTTP receivers' white lists / black lists in that they don't support IPv6 yet. What's worse, the pattern*.*.*.*
still blocks all IPv6 addresses! So, try using127.0.0.1
instead of localhost. -
@phildunlap I solved, even with Fiddler assigns the value to the variable by making a call to both GET and POST.
I will try to pass more values. -
Glad to hear you got it working!
The Set Point URL you have configured seems a little odd to me. The set point url is where to reach out to with a message if one of the HTTP points is set. So, if you have it pointed at the local httpds, you may be setting those values into other HTTP (or the same) point. Not sure what the objective is.