POSTVALUE        Add a value to an HTTP/HTTPS POST Request

Top  Previous  Next

Syntax:

POSTVALUE

[ name ] [ value ] [options]

Arguments:

[ name ]

The post field name / identifier

 

[ value ]

The field value or file.

Options:

/file

Specifies that the [ value ] argument represents the name of a file to POST.

 

/contenttype

Specifies the content type of the file specified in the [ value ] argument above. This option is only relevant when combined with the with the /file option and when the POST Request's content-type was prepared as "multipart/form-data".

 

 

This script command adds one name/value pair to a Request body previously created with the PREPAREPOST command. You will typically call this command once for each field you wish to populate on a web form. Requests prepared with these commands are typically submitted to web forms via the HTTPPOST command.

 

The POSTVALUE command may only be used after you first issue the PREPAREPOST command to create the Request body and specify the content-type. This example adds a name/value pair to a previously prepared Request:

 

         POSTVALUE "FirstName" "John"

 

The /file option puts the file specified in the [ value ] argument into the POST Request. The following example adds a file named "report.zip" to the Request body:

 

POSTVALUE "Userfile" "report.zip" /file /contenttype="application/zip"

 

The /contenttype option allows you to specify the content type of the file being uploaded.  The terms "MIME type" or "Internet media type" are sometimes used as synonyms for content type and refer to an individual file.  It is possible to upload multiple files of of different types in a single Request.  Despite the similar name, file content types serve a different purpose than the HTTP Content-Type header argument required by the PREPAREPOST command.

 

 

Related command(s): PREPAREPOST, HTTPPOST

See also: HTTP Considerations