Skip to main content

EnsLib.HTTP.OutboundAdapter

class EnsLib.HTTP.OutboundAdapter extends Ens.OutboundAdapter

Adapter for sending HTTP requests to a designated HTTP server, with HTTP headers, URL, form variables and cookies if so invoked

Property Inventory

Method Inventory

Parameters

parameter DEBUG = 0;
This is the debug flag setting (0 do nothing, 1 show request, 2 show request/response)
parameter SETTINGS = RegistryID:Basic:selector?context={Ens.ServiceRegistry.External.ContextSearch/Services?Protocols_1=REST&Protocols_2=HTTP},HTTPServer:Basic,HTTPPort:Basic,SSLConfig:Connection:sslConfigSelector,SSLCheckServerIdentity:Connection,LocalInterface:Connection:selector?context={Ens.ContextSearch/TCPLocalInterfaces},ProxyServer:Connection,ProxyPort:Connection,ProxyHTTPS:Connection,ProxyHttpTunnel:Connection,URL:Basic,Credentials:Basic:credentialsSelector,UseCookies,ConnectTimeout:Connection,ResponseTimeout:Connection,WriteTimeout:Connection,ProvideMetricsForSAM:Alerting;
These are the production settings for this object

Properties

property %Cookies as %String [ MultiDimensional , Transient ];
Array of Cookies. Indexed by Domain/Server; each element is $LB(name, domain, path, value, expires, secure)
Property methods: %CookiesDisplayToLogical(), %CookiesGet(), %CookiesIsValid(), %CookiesLogicalToDisplay(), %CookiesLogicalToOdbc(), %CookiesNormalize(), %CookiesSet()
property ConnectTimeout as %Numeric (MINVAL = 0) [ InitialExpression = 5 ];
Number of seconds to wait on each connection attempt
Property methods: ConnectTimeoutDisplayToLogical(), ConnectTimeoutGet(), ConnectTimeoutIsValid(), ConnectTimeoutLogicalToDisplay(), ConnectTimeoutNormalize(), ConnectTimeoutSet()
property Credentials as %String [ InitialExpression = "None" ];
This is the ID name of the set of credentials values (Username, Password) to be used to access the HTTP server
Property methods: CredentialsDisplayToLogical(), CredentialsGet(), CredentialsIsValid(), CredentialsLogicalToDisplay(), CredentialsLogicalToOdbc(), CredentialsNormalize()
property HTTPPort as %Integer (MAXVAL = 65535, MINVAL = 0);
TCP Port on the server to send HTTP requests to (will use 80 by default, or 443 if SSLConfig is specified)
Property methods: HTTPPortDisplayToLogical(), HTTPPortGet(), HTTPPortIsValid(), HTTPPortLogicalToDisplay(), HTTPPortNormalize(), HTTPPortSet()
property HTTPServer as %String (MAXLEN = 1000) [ Required ];
IP address of the server to send HTTP requests to.
Property methods: HTTPServerDisplayToLogical(), HTTPServerGet(), HTTPServerIsValid(), HTTPServerLogicalToDisplay(), HTTPServerLogicalToOdbc(), HTTPServerNormalize(), HTTPServerSet()
property LocalInterface as %String (MAXLEN = 250);
In a multi-homed system, specify which network interface the TCP connection should go through. An empty value means to use any interface.
To be able to bind to IPv6 interfaces you may need to enable IPv6 in your instance. This is done in the System Management Portal under System Administration > Configuration > Additional Settings > Startup, by editing the IPv6 setting.
Property methods: LocalInterfaceDisplayToLogical(), LocalInterfaceGet(), LocalInterfaceIsValid(), LocalInterfaceLogicalToDisplay(), LocalInterfaceLogicalToOdbc(), LocalInterfaceNormalize(), LocalInterfaceSet()
property ProvideMetricsForSAM as %Boolean [ InitialExpression = 0 ];
If System Alert and Monitoring for interoperability is enabled then report HTTP request metrics as given in Ens.SAM.SensorDefinitions for EnsHTTPRequest.
Property methods: ProvideMetricsForSAMDisplayToLogical(), ProvideMetricsForSAMGet(), ProvideMetricsForSAMIsValid(), ProvideMetricsForSAMLogicalToDisplay(), ProvideMetricsForSAMNormalize(), ProvideMetricsForSAMSet()
property ProxyHTTPS as %Boolean;
Should the proxy (if any) use HTTPS to communicate with the real HTTP/HTTPS server?
Property methods: ProxyHTTPSDisplayToLogical(), ProxyHTTPSGet(), ProxyHTTPSIsValid(), ProxyHTTPSLogicalToDisplay(), ProxyHTTPSNormalize(), ProxyHTTPSSet()
property ProxyHttpTunnel as %Boolean [ InitialExpression = 0 ];
Should the Adapter use the HTTP CONNECT command to establish a tunnel through the proxy to the target HTTP server?
Property methods: ProxyHttpTunnelDisplayToLogical(), ProxyHttpTunnelGet(), ProxyHttpTunnelIsValid(), ProxyHttpTunnelLogicalToDisplay(), ProxyHttpTunnelNormalize(), ProxyHttpTunnelSet()
property ProxyPort as %Integer (MAXVAL = 65535, MINVAL = 0);
Proxy server port on which to send HTTP requests, if using a proxy server (will use 8080 by default)
Property methods: ProxyPortDisplayToLogical(), ProxyPortGet(), ProxyPortIsValid(), ProxyPortLogicalToDisplay(), ProxyPortNormalize(), ProxyPortSet()
property ProxyServer as %String (MAXLEN = 1000);
Proxy server through which to send HTTP requests, if any
Property methods: ProxyServerDisplayToLogical(), ProxyServerGet(), ProxyServerIsValid(), ProxyServerLogicalToDisplay(), ProxyServerLogicalToOdbc(), ProxyServerNormalize(), ProxyServerSet()
property ResponseTimeout as %Numeric (MINVAL = -1) [ InitialExpression = 30 , Required ];
Timeout for getting a response from the server (the timeout for opening the connection to the server is always 5 seconds). Setting the timeout to -1 means wait forever.
Property methods: ResponseTimeoutDisplayToLogical(), ResponseTimeoutGet(), ResponseTimeoutIsValid(), ResponseTimeoutLogicalToDisplay(), ResponseTimeoutNormalize(), ResponseTimeoutSet()
property SAMDefinitionClass as %String [ InitialExpression = "Ens.SAM.SensorDefinitions" ];
Class that contains the XData JSON definition
Property methods: SAMDefinitionClassDisplayToLogical(), SAMDefinitionClassGet(), SAMDefinitionClassIsValid(), SAMDefinitionClassLogicalToDisplay(), SAMDefinitionClassLogicalToOdbc(), SAMDefinitionClassNormalize(), SAMDefinitionClassSet()
property SAMDefinitionXData as %String [ InitialExpression = "EnsHTTPRequest" ];
XData JSON definition name
Property methods: SAMDefinitionXDataDisplayToLogical(), SAMDefinitionXDataGet(), SAMDefinitionXDataIsValid(), SAMDefinitionXDataLogicalToDisplay(), SAMDefinitionXDataLogicalToOdbc(), SAMDefinitionXDataNormalize(), SAMDefinitionXDataSet()
property SSLCheckServerIdentity as %Boolean [ InitialExpression = 1 ];
When making an SSL connection check the server identity in the certificate matches the name of the system we are connecting to. This defaults to being on and matches based on the rules layed out in section 3.1 of RFC 2818.
Property methods: SSLCheckServerIdentityDisplayToLogical(), SSLCheckServerIdentityGet(), SSLCheckServerIdentityIsValid(), SSLCheckServerIdentityLogicalToDisplay(), SSLCheckServerIdentityNormalize(), SSLCheckServerIdentitySet()
property SSLConfig as %String;
The name of an existing SSL/TLS system configuration set to use (Secure Socket Layer / Transport Layer Security, configured via the system portal's Security Management page).

If your SSL Configuration requires you to supply a password for the local private key file, specify it in the Private key password property of the SSL/TLS Configuration.

Property methods: SSLConfigDisplayToLogical(), SSLConfigGet(), SSLConfigIsValid(), SSLConfigLogicalToDisplay(), SSLConfigLogicalToOdbc(), SSLConfigNormalize(), SSLConfigSet()
property SkipBodyAttrs as %String [ InitialExpression = "*" ];
A comma-separated list of body stream attribute names that should not be copied to the outbound HTTP header. The default value of "*" means to skip all, i.e. to copy none. If this value is empty and the input stream is a %Library.AbstractStream subclass, then double copying of the stream data will be avoided by passing the stream object directly through to the %Net.HttpRequest.Send() method.
Property methods: SkipBodyAttrsDisplayToLogical(), SkipBodyAttrsGet(), SkipBodyAttrsIsValid(), SkipBodyAttrsLogicalToDisplay(), SkipBodyAttrsLogicalToOdbc(), SkipBodyAttrsNormalize(), SkipBodyAttrsSet()
property URL as %String (MAXLEN = 1000) [ Required ];
URL path to request from the server (not including 'http://' or server address)
  • If set to empty or '*' and used on a GenericOperation, this setting will employ the HTTPHeaders array value for the key 'URL' (case insensitive) contained in the GenericMessage being processed.
  • If this value starts with '^' and is used on a GenericOperation, this setting will remove the Application attribute from the URL of the GenericMessage being processed and replace it with the remaining portion of this value if any. If combined with '*' the '^' should come first.
  • If this value starts with '|' and is used on a GenericOperation, this setting will remove the Application and ConfigName attributes from the URL of the GenericMessage being processed and replace them with the remaining portion of this value if any. If combined with '*' the '|' should come first.
Property methods: URLDisplayToLogical(), URLGet(), URLIsValid(), URLLogicalToDisplay(), URLLogicalToOdbc(), URLNormalize(), URLSet()
property UseCookies as %Boolean [ InitialExpression = 0 ];
Save Cookies received in HTTP responses while this adapter is instantiated, and insert them in each subsequent HTTP request.
Property methods: UseCookiesDisplayToLogical(), UseCookiesGet(), UseCookiesIsValid(), UseCookiesLogicalToDisplay(), UseCookiesNormalize(), UseCookiesSet()
property WriteTimeout as %Numeric (MINVAL = -1) [ InitialExpression = -1 ];
Set this to the timeout to use when writing to the remote HTTP server.
The default is -1 means it will wait indefinitely for the remote server to accept the written data, change it to another value to specify the timeout in seconds.
Property methods: WriteTimeoutDisplayToLogical(), WriteTimeoutGet(), WriteTimeoutIsValid(), WriteTimeoutLogicalToDisplay(), WriteTimeoutNormalize(), WriteTimeoutSet()

Methods

method Delete(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
Send a DELETE to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. To use a request Body instead of form variables, leave pFormVarNames empty and pass the body text as the pData argument. Otherwise, for each name in the list, a pData argument should be supplied. If you need to pass multiple values for any form variable, you can put the name of that variable multiple times in the pFormVarNames list. Also, any extra pData arguments will be assigned to the last form variable in the list. Note: Data values passed for body text may be of either String type or Stream. Data values passed for form variables must be of String type.
method DeleteCookie(pName As %String, pPath As %String, pDomain As %String) as %Status
Delete a particular Cookie
method DeleteCookies(pDomain As %String = "", pPath As %String = "") as %Status
Delete all cookies from the specified domain and/or path
method DeleteFormDataArray(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, ByRef pData) as %Status
Send a DELETE to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. For each name in the list, a pData argument should be supplied. The pData argument is an array. The top node of the array is not used. Each sub-node is subscripted by the index of the form variable from the pFormVarNames list that it corresponds to. The value at that subscript is the form data for that variable. For single-valued form variables this value is just the value. In this case this node should have no sub-nodes. For multiple valued form variables, the value at this node should be the count of form variable values, and each of the values for this form variable should appear in a sub-node, subscripted by its position in the node.
method DeleteURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
method Get(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
Send a GET to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. To use a request Body instead of form variables, leave pFormVarNames empty and pass the body text as the pData argument. Otherwise, for each name in the list, a pData argument should be supplied. If you need to pass multiple values for any form variable, you can put the name of that variable multiple times in the pFormVarNames list. Also, any extra pData arguments will be assigned to the last form variable in the list. Note: Data values passed for body text may be of either String type or Stream. Data values passed for form variables must be of String type.
method GetFormDataArray(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, ByRef pData) as %Status
Send a GET to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. For each name in the list, a pData argument should be supplied. The pData argument is an array. The top node of the array is not used. Each sub-node is subscripted by the index of the form variable from the pFormVarNames list that it corresponds to. The value at that subscript is the form data for that variable. For single-valued form variables this value is just the value. In this case this node should have no sub-nodes. For multiple valued form variables, the value at this node should be the count of form variable values, and each of the values for this form variable should appear in a sub-node, subscripted by its position in the node.
method GetURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
method OnExitSendData(ByRef pHttpRequest As %Net.HttpRequest)
Carry out various internal tasks when exiting the SendFormDataArray method
method OnInit() as %Status
Inherited description: This user callback method is called just after %OnNew()
method OnTearDown() as %Status
Inherited description: This user callback method is called just before %OnClose()
method Patch(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
Send a PATCH to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. To use a request Body instead of form variables, leave pFormVarNames empty and pass the body text as the pData argument. Otherwise, for each name in the list, a pData argument should be supplied. If you need to pass multiple values for any form variable, you can put the name of that variable multiple times in the pFormVarNames list. Also, any extra pData arguments will be assigned to the last form variable in the list. Note: Data values passed for body text may be of either String type or Stream. Data values passed for form variables must be of String type.
method PatchFormDataArray(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, ByRef pData) as %Status
Send a PATCH to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. For each name in the list, a pData argument should be supplied. The pData argument is an array. The top node of the array is not used. Each sub-node is subscripted by the index of the form variable from the pFormVarNames list that it corresponds to. The value at that subscript is the form data for that variable. For single-valued form variables this value is just the value. In this case this node should have no sub-nodes. For multiple valued form variables, the value at this node should be the count of form variable values, and each of the values for this form variable should appear in a sub-node, subscripted by its position in the node.
method PatchURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
method Post(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
Send a POST to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. To use a request Body instead of form variables, leave pFormVarNames empty and pass the body text as the pData argument. Otherwise, for each name in the list, a pData argument should be supplied. If you need to pass multiple values for any form variable, you can put the name of that variable multiple times in the pFormVarNames list. Also, any extra pData arguments you supply will be assigned to the last form variable in the list. Note: A Data value passed for body text may be of either String type or Stream. Data values passed for form variables must be of String type.
method PostFormDataArray(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, ByRef pData) as %Status
Send a POST to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. For each name in the list, a pData argument should be supplied. The pData argument is an array. The top node of the array is not used. Each sub-node is subscripted by the index of the form variable from the pFormVarNames list that it corresponds to. The value at that subscript is the form data for that variable. For single-valued form variables this value is just the value. In this case this node should have no sub-nodes. For multiple valued form variables, the value at this node should be the count of form variable values, and each of the values for this form variable should appear in a sub-node, subscripted by its position in the node.
method PostURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
method Put(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
Send a PUT to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. To use a request Body instead of form variables, leave pFormVarNames empty and pass the body text as the pData argument. Otherwise, for each name in the list, a pData argument should be supplied. If you need to pass multiple values for any form variable, you can put the name of that variable multiple times in the pFormVarNames list. Also, any extra pData arguments will be assigned to the last form variable in the list. Note: Data values passed for body text may be of either String type or Stream. Data values passed for form variables must be of String type.
method PutFormDataArray(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, ByRef pData) as %Status
Send a PUT to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. For each name in the list, a pData argument should be supplied. The pData argument is an array. The top node of the array is not used. Each sub-node is subscripted by the index of the form variable from the pFormVarNames list that it corresponds to. The value at that subscript is the form data for that variable. For single-valued form variables this value is just the value. In this case this node should have no sub-nodes. For multiple valued form variables, the value at this node should be the count of form variable values, and each of the values for this form variable should appear in a sub-node, subscripted by its position in the node.
method PutURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status
method SendFormData(Output pHttpResponse As %Net.HttpResponse, pOp As %String, pHttpRequestIn As %Net.HttpRequest, pFormVarNames As %String, pData...) as %Status
method SendFormDataArray(Output pHttpResponse As %Net.HttpResponse, pOp As %String, pHttpRequestIn As %Net.HttpRequest, pFormVarNames As %String = "", ByRef pData, pURL As %String) as %Status
Send a pOp request ("POST","GET","PUT" or "PATCH") to the configured Server, Port and URL, sending form data to the named form variables. pFormVarNames is a comma-separated list of form variable names to use. For each name in the list, a pData argument should be supplied. The pData argument is an array. The top node of the array is not used. Each sub-node is subscripted by the index of the form variable from the pFormVarNames list that it corresponds to. The value at that subscript is the form data for that variable. For single-valued form variables this value is just the value. In this case this node should have no sub-nodes. For multiple valued form variables, the value at this node should be the count of form variable values, and each of the values for this form variable should appear in a sub-node, subscripted by its position in the node. For special needs, the pHttpRequestIn argument can be used to pre-populate properties of the %Net.HTTPRequest object used to send the HTTP request.
method SendFormDataURL(pURL As %String, Output pHttpResponse As %Net.HttpResponse, pOp As %String, pHttpRequestIn As %Net.HttpRequest, pFormVarNames As %String, pData...) as %Status

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab