class EnsLib.HTTP.InboundAdapter
extends EnsLib.TCP.InboundAdapter
HTTP Listener for custom port listening, XML listening, and/or raw HTML handling
parameter Mode = "SW";
Override the Device Mode that will be used to open the TCP socket
parameter SERVICEINPUTCLASS = "%Stream.Object";
parameter SERVICEOUTPUTCLASS = "%Stream.Object";
parameter SETTINGS = "Charset::selector?context={Ens.ContextSearch/CharacterSets},ForceCharset";
List of properties can be set as settings in the configuration file
format is a comma separated list of property names
property %ToLowerHeaderVars
as %Boolean [ InitialExpression = 1 ];
Set this to 0 to prevent normalizing of HTTP header variable names to lowercase
property Charset
as %String [ InitialExpression = "Auto" ];
Text Charset to use to decode incoming data. In addition to standard Character Encoding identifiers, allowed values are Auto,AutoXML,Binary,and RawBytes.
Auto means use the encoding declared in the incoming HTTP header Content-Type field.
AutoXML means use the encoding declared in the XML header of the incoming XML body content, if any.
RawBytes or Binary mean to read the raw bytes of the body without any Character Encoding transformation. This is the default action.
property ForceCharset
as %Boolean [ InitialExpression = 0 ];
If True, use the Charset setting rather than any charset that may be declared in the incoming HTTP header Content-Type field
property ParseBodyFormVars
as %Boolean;
Set this property from onInit() in your Service class to make the adapter parse form variables from the form body in case of a form POST
property Port
as Ens.DataType.TCPAgentPort [ InitialExpression = "9980",Required ];
Local TCP port to listen on for HTTP requests
property StayConnected
as %Numeric(MINVAL=-1) [ InitialExpression = 0 ];
If non-zero, stay connected to the remote system between handling Requests until idle for this number of seconds. A value of -1 means never disconnect.
method OnConnected()
as %Status
method OnTask()
as %Status
default InboundAdapter behavior: always call ProcessInput on CallInterval