Task ps-http
This task has been removed as of PageSeeder v6. Use Ant Get task or Ant-Contrib Post task instead.
This simple task is used to make an HTTP request to a given URL.
Definition
<ps:ps-http url="[url]"
username="[username]"
password="[password]"
output="[output]"
method="[method]">
<part name="[part name]"
value="[part value]"
contentType="[part content-type]" />
<part name="[part name]"
srcFile="[file path]"
ignoreFileName="[true|
false]"
contentType="[part content-type]" />
</ps:ps-http>
Attributes
| Attribute | Description | Required |
|---|---|---|
| url | The URL to connect to. | Yes |
| output | Specifies the path of the file to write the response to. | Yes |
| username | The username to use for basic authentication. | No |
| password | The password use for basic authentication. | No |
| method | The connection method to use (GET or POST, default is GET). | No |
Parts
If the method specified is POST, the contents of the requests are specified using nested elements named part.
Part Attributes
| Attribute | Description | Required |
|---|---|---|
| name | The name of the part. | Yes |
| value | The content of the part. | Yes, if srcFile is not specified |
| srcFile | The path of an external file which content is used as this part's content. | Yes, if value is not specified |
| contentType | The part's content type. | Yes |
| ignoreFileName | If "true", the file name is not sent. It is only used when attribute @srcFile is used (true or false, default is false). | No |
Examples
Here are a few simple examples:
<ps:ps-http url="http://www.google.com.au/search?q=test"
output="search.html" />
<ps:ps-http url="http://publishing.server.com/publish?jobid=123456"
username="guest" password="anonymous"
output="response.xml" method="POST">
<part name="jobparams" srcFile="params.xml" contentType="text/xml" />
<part name="contents" srcFile="file.xml" contentType="text/xml" />
</ps:ps-http>