HTTP Server Connector Version 2
Overview
The HTTP server Connector listens for incoming HTTP connections and returns
the GET parameters as an entry. If a Parser is specified then the Connectors
will process POST requests and parse the contents using the specified Parser.
GET requests will not use the Parser. If a POST request is received and no Parser
is specified the contents of the POST data will be returned as an
attribute ("postdata") in the returned entry.
The HTTP Server Version 2 uses metamerge.HTTP as internal parser if no parser
is specified. Version 1 had hardcoded internal java-code and is
deprecated.
The Connector will parse URL requests and populate an entry in the following
manner:
If a POST request is used then it is expected that the requestor is sending
data on the connection as well. Depending on the value for the parser
parameter the Connector will do the following:
Parser Present? |
Action |
Yes |
Instantiate the Parser with the HTTP input stream. Connector
will delegate getNext to the Parser's getEntry and return whatever the Parser
returns. |
No |
Put contents of post data in a attribute called postdata.
entry.postdata = "<post data>" |
The session with the HTTP client is closed when the Connector receives a
getNext request from the AssemblyLine and there is no more data to fetch. I.e.
if the Parser has returned a null value, or on the second call to getNext if no Parser
is present.
Configuration
The Connector needs the following parameters:
Parameter |
Description |
connectorType |
com.architech.connector.HTTPServer |
port |
The TCP port to listen to (default = 80) |
parser |
The name of a Parser to handle the contents of
POST requests |
See Also
URL Connector, HTTP
Client2 Connector, HTTP Parser
|