Sends HTTP request to the specified URL and gets HTTP response as a result. First the body of the processor is executed in order to define optional HTTP parameters and/or headers and then sends HTTP request.

Syntax

<http url="url"
      method="method"
      charset="charset"
      cookie-policy="cookie_policy"
      username="username"
      password="password">
    body that might contain http-param and/or http-header elements
</http>

Attributes

Name Required Default Description
url yes HTTP request URL.
method no get HTTP method: get or post
charset no [Default charset for config] Defines encoding of the HTTP response content. Has no effect if content type is binary.
cookie-policy no [Default cookie policy of the HTTP client] Specifies the way how HTTP client manages cookies. Allowed values are: browser, ignore, netscape, rfc_2109 and default.
username no Specifies username if URL requires authentication.
password no Specifies password if URL requires authentication.

Example

<xpath expression="data(//script)">
    <html-to-xml>
        <http url="http://www.yahoo.com/"/>
    </html-to-xml>
</xpath>

The content of www.yahoo.com is downloaded, transformed to XML and then all scripts inside the page are found.