Follow the steps below to log into a site, post a file, and issue a get command to retrieve a file on a web server. This example assumes the file would only be accessible if the login is successful:
To start the Post example, from within the Project Designer page, expand the Web folder in the Component Library, and then drag the HTTP task to the Project Outline.
On the Basic tab of the Post Method element, specify the URI value:
URI
the URI (Uniform Resource Identifier), also known as
URL
(Uniform Resource Locator), (for example, /data/orders.xls). If left blank, the default URI of the server is requested.
Content Type
Specify the value to send in the Content-Type header field when making the request. When you post files (with or with out parameters) then the content type is set to 'multipart/mixed'.
Click the
Add
button in the sub-menu and select the
Add a Request Parameter
menu item.
On the Basic tab of the Request Parameter element, specify values for the following attributes:
Name
The name for this parameter.
Value
The value for this parameter.
Click the
Add
button in the sub-menu and select the Add Same menu item.
On the Basic tab of the Request Parameter element, specify values for the following attributes:
Name
The name for this parameter.
Value
The value for this parameter.
Select the Post element from the Project Outline. Click the
Add
button in the sub-menu and select the Add a File menu item.
On the Basic tab of the Add a File element, specify values for the following attributes:
Name
Specify the parameter (or part) name for this file name. The specified name will be sent to the server as a header in the Multi-Part data.
Path
Specify the location of the file to upload.
For the Get example, in the
Project Outline
window on the left side of the page right-click the
HTTP
task and select the
Add a Get Method
from the drop-down menu.
On the Basic tab of the Get Method element, specify the URI values:
URI
the URI (Uniform Resource Identifier), also known as
URL
(Uniform Resource Locator), (for example, /documents/data.txt). If left blank, the default URI of the server is requested (for example, www.example.com).
On the Response Body tab of the Get Method element, specify the Destination value:
Destination
Where the response body, if any, should be saved. By default, the response body will be saved to the job log.
On the Response Headers tab of the Get Method element, specify the File value:
Response Body File
The location of the file to which the response body, if any, should be saved. This is required if the