HTTP header adapter command (-HDR) example

Process cookies by mapping Set-Cookie headers to Cookie headers.

This example uses the Header adapter command (-HDR), Http.mtt schema, and the HTTPGetCookie map. It retrieves a form that sets cookies and then submits the form. The form includes user name and password fields typical of the forms found on many web sites and uses cookies to maintain this login information.

In the input card, the GET > Source > Command in the Source setting uses the -HDR command to map the cookies in the Set-Cookie headers on the form that is returned.

In the output card, the PUT > Target > Command in the Target setting manages the cookie state information by mapping the Set-Cookie headers in the form to Cookie headers. The -HDR command indicates that the user is providing the headers; the target is form data submitted with:

Content-Type application/x-www-form-url-encoded.

See RFC 2109 for more information about cookies. For more information about submitting forms and the x-www-form-url-encoded format, see Section 17 of the HTML 4.01 specification.