Publishing

Publishing PageSeeder data to print, the Web or both

Task ps-http

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

AttributeDescriptionRequired
urlThe URL to connect to.Yes
outputSpecifies the path of the file to write the response to.Yes
usernameThe username to use for basic authentication.No
passwordThe password use for basic authentication.No
methodThe 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

AttributeDescriptionRequired
nameThe name of the part.Yes
valueThe content of the part.Yes, if srcFile is not specified
srcFileThe path of an external file which content is used as this part's content.Yes, if value is not specified
contentTypeThe part's content type.Yes
ignoreFileNameIf "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>

Created on , last edited on