---
title: "Task ps-http (obsolete)"
source: https://dev.pageseeder.com/reference/version_5/ant_tasks/task_ps-http.html
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~600
---

# Task ps-http

> **Obsolete:** This task has been removed as of PageSeeder v6. Use [Ant Get](https://ant.apache.org/manual/Tasks/get.html) task or [Ant-Contrib Post](http://ant-contrib.sourceforge.net/tasks/tasks/post_task.html) task instead.

This simple task is used to make an HTTP request to a given URL.

## Definition

```xml

         <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:

```xml

<ps:ps-http url="http://www.google.com.au/search?q=test"
         output="search.html" />
```

```xml

<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>
```

