When data is sent to a web server using a POST operation it is most often sent using the default content type of application/x-www-form-urlencoded which has all the content in one single line of text. However, it is possible to send data with another content type called: multipart/form-data which can contain multiple lines of text. When sending data as multipart/form-data it is common to specify the boundary marker for the data fields.

The content type and boundary marker is usually specified in the HTTP headers with a line such as the following:

multipart/form-data; boundary=---------------------------7da13855b03ac 

To use this type of content type with the GNW transaction agent it is necessary to put the POST data into a separate file that the agent will read and use as POST data. (See Mapping Transactions for more information about setting this up in line 4 of a transaction step in a GNW transaction script.)

When creating the POST data file, if the content type is multipart/form-data then the first line of the file must be the content type declaration and boundary declaration as found in the HTTP headers. This first line must end with a hash symbol (#) to mark the end of the content type declaration.

Example of first line from a post data file that uses multipart/form-data:

multipart/form-data; boundary=---------------------------7da13855b03ac # 

Note the hash symbol that ends the line. Without this the GNW agent will not be able to distinguish where the content type declaration ends and the actual content begins.

For more information about content types see http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

Posting Multipart Form Data (last edited 2010-07-12 22:10:49 by Eric)