NextGen Knowledge Center

HTTP Listener

This source connector acts as an HTTP server, listening for requests from one or more remote clients. The messages sent to the channel can be the raw payload, or an XML document allowing multipart payloads to be parsed in a consistent and easy-to-use way. The HTTP payload can be either Base64 encoded or converted using a charset, depending on the Content-Type. Responses that go back to each client can be fully configured, including custom response headers. Finally, static resources or directories can be automatically hosted, to allow the connector to act as a simple web server that serves specific content. Additional options are available with the SSL Manager extension.

Supported property groups:

ItemNameDefault ValueDescription
ABase Context Path The context path for the HTTP Listener URL.
BReceive Timeout (ms)30000The maximum idle time in milliseconds for a connection.
CMessage ContentPlain Body
  • Plain Body: The request body will be sent to the channel as a raw string.
  • XML Body: The request body will be sent to the channel as serialized XML.
DParse MultipartYes

Applies only to Message Content XML Body.

  • Select Yes to automatically parse multipart requests into separate XML nodes.
  • Select No to always keep the request body as a single XML node.
EInclude MetadataNo

Applies only to Message Content XML Body.

Select Yes to include request metadata (method, context path, headers, query parameters) in the XML content.
FBinary MIME Types

application/.*

(?<!json|xml)$|

image/.*|video

/.*|audio/.*

When a response comes in with a Content-Type header that matches one of these entries, the content will be encoded into a Base64 string.
  • If Regular Expression is unchecked, specify multiple entries with commas.
  • If Regular Expression is checked,, enter a valid regular expression to match MIME types against.
GHTTP URL<auto-generated>

Displays the generated HTTP URL for the HTTP Listener. This is not an actual configurable setting, but is instead displayed for copy/paste convenience.

HResponse Content Typetext/plainThe MIME type to be used for the response.
IResponse Data TypeText
  • If Binary is selected, responses is decoded from Base64 into raw byte streams.
  • If Text is selected, responses is encoded with the specified character set encoding.
JCharset EncodingUTF-8Select the character set encoding to be used for the response to the sending system. Set to Default to assume the default character set encoding for the JVM Mirth® Connect by NextGen Healthcare is running on.
KResponse Status Code 

Enter the status code for the HTTP response.

  • If this field is left blank, a default status code of 200 is returned for a successful message, and 500 is returned for an errored message.
  • If a Response is chosen in the Source Settings, the status of that response is used to determine a successful or errored response.
LResponse Headers Map VariableUse Table
  • Use Table: The table below will be used to populate response headers.
  • Use Map: The Java map specified by the following variable will be used to populate response headers. The map must have String keys and either String or List<String> values.
MResponse Headers When using the Use Table option above, enter custom headers to send back to the originating client
NStatic Resources 

Values in this table are automatically sent back to any request with the matching context path. There are three resource types:

  • File: The value field specifies the path of the file to return.
  • Directory: Any file within the directory given by the value field may be requested, but subdirectories are not included.
  • Custom: The value field itself is returned as the response.