HTTP Bindings in Perspective
HTTP Binding
Watch the videoThe HTTP Binding type allows you to use HTTP get/post protocols to interface with other API's.
JSON Support​
One perk of the HTTP binding is the ability to fetch JSON documents from a website or an API. Since the Perspective property tree is also JSON-formatted, this allows you to dynamically create a property structure from a JSON document directly.
HTTP Binding Configuration​
Binding Property | Description |
---|---|
URL | An expression indicating what web address to reference on the binding. If entering a static URL, quotation marks must be used. |
Method | Any HTTP method. Used to send HTTP requests to the specified URL. See Method. |
Headers | Used to pass key/value pairs in the header of our HTTP requests. See Headers. |
Body | An expression indicating what to send in the body of our HTTP requests. |
Authentication Type | Indicates what HTTP authentication type to use. Equivalent to specifying the Authorization key in the header. Options are None, Basic, Bearer, or Digest. |
Authentication Value | The Authentication Value field takes an expression that should indicate what authorization string or token should be used in combination with the associated authentication type. For example, if the header should contain the string:Authorization: Basic aWduaXRpb246cGFzc3dvcmQ= Then the Authentication Type should be Basic and the Authentication Value should be aWduaXRpb246cGFzc3dvcmQ=. |
Connect Timeout | Indicates how long the Ignition Gateway should wait for a response to our connect request. |
Socket Timeout | Indicates how long the Ignition Gateway should wait for a response to a given HTTP request. |
Enabled | Indicates whether the binding should be active. |
Overlay Opt-Out | Indicates whether the component should reflect a bad quality binding via a Tag overlay. |
Allow Cookies | Indicates whether to allow the remote web server to store cookies. |
Cache & Share | ​ New in 8.1.12 When this setting is enabled, the binding will utilize a polling engine that is shared across all running Perspective sessions. The polling engine will poll once, cache the value, and deliver the results to all registered consumers. The cache persists for a period of time that matches the configured poll rate. If polling is off, the default cache duration is 250 milliseconds. This optimization is helpful for consolidating multiple identical polling tasks, particularly when you have many Perspective sessions running at once. Disabling this option will bypass the cache. |
Polling | Controls how frequently HTTP requests should be issued, and therefore how often the binding should be updated. |
Method​
Method | Definition |
---|---|
GET | The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. |
HEAD | The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. |
POST | The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. |
PUT | The PUT method requests that the enclosed entity be stored under the supplied Request-URI. |
DELETE | The DELETE method requests that the origin server delete the resource identified by the Request-URI. |
TRACE | The TRACE method is used to invoke a remote, application-layer loop- back of the request message. |
CONNECT | The CONNECT method starts two-way communications with the requested resource. It can be used to open a tunnel. |
Headers​
Field | Definition |
---|---|
Key | Allows dropdown selection from common header keys, or the ability to specify a custom one. |
Value | The Value field is an expression. |