Example files

An example for this adapter is located at install_dir/examples/adapters/http.

Using the Map Designer, select HTTP from the Source setting in an Input Card dialog. In the GET Source > Command field, type the -URL command to specify the uniform resource locator (URL) specifying the HTTP server, the file to transfer, and other required adapter commands. In this input card example, the HTTP Adapter retrieves the test.htm file from host server puff:
-URL HTTP//user1:test@puff:8080/c:/test/tst.htm

The adapter specifies the original.htm file to be used as the data source. The -TV adapter command specifies that the adapter generate a verbose trace file containing a log of all activity and events occurring while the adapter is retrieving data. The -REDIR 3 adapter command specifies that the HTTP Adapter will follow three file redirections (or "document moved" messages) before the file transfer request fails.

Using the Input Source Override - Application Execution Command (-IA), this command string example can be used to override the adapter commands defined in output card 1:
-IAHTTP1 '-URL HTTP://user1:test@puff:8080/c:/test/test.htm'

This example command string causes the file test.htm to be retrieved from host server puff.

Use the M4HHTP_OPT environment variable to specify commands to the HTTP Adapter or a command file containing adapter commands.
Note: Commands specified in the input or output card settings override commands specified in the environment variable.

The format for specifying commands is:

M4HHTP_OPT=adaptercommands

where adaptercommands are the HTTP Adapter commands in the list of commands.

The format for specifying a command file is:

M4HTTP_OPT=@filename.txt

where filename.txt is the file containing HTTP Adapter commands. Always precede the command file name with @.