Home > Class Reference > ENSLIB namespace > EnsLib.HTTP.OutboundAdapter

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;
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(), CredentialsSet()
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 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 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 [ Language = objectscript ]
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 [ Language = objectscript ]
Delete a particular Cookie
method DeleteCookies(pDomain As %String = "", pPath As %String = "") as %Status [ Language = objectscript ]
Delete all cookies from the specified domain and/or path
method DeleteFormDataArray(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, ByRef pData) as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
method Get(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
method OnInit() as %Status [ Language = objectscript ]
Inherited description: This user callback method is called just after %OnNew()
method Post(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
method Put(Output pHttpResponse As %Net.HttpResponse, pFormVarNames As %String, pData...) as %Status [ Language = objectscript ]
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 [ Language = objectscript ]
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 [ Language = objectscript ]
method SendFormData(Output pHttpResponse As %Net.HttpResponse, pOp As %String, pHttpRequestIn As %Net.HttpRequest, pFormVarNames As %String, pData...) as %Status [ Language = objectscript ]
method SendFormDataArray(Output pHttpResponse As %Net.HttpResponse, pOp As %String, pHttpRequestIn As %Net.HttpRequest, pFormVarNames As %String = "", ByRef pData, pURL As %String) as %Status [ Language = objectscript ]
Send a pOp request ("POST","GET" or "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. 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 [ Language = objectscript ]

Inherited Methods

Subclasses