This is a very simple wrapper around Jetty's HTTPClient. Only PUT and GET requests are supported. Basic Authentication is supported, and so are SSL connections.
basicAuthentication | Provide Username/Password for Basic Authentication. |
content | The request body to send or the response body received. |
contentLength | Content length of a response. |
contentType | The content-type of a POST request. |
downloadCount | The bytes downloaded so far. |
method | The request method. |
name | The name of the job. |
output | The output (such as a file) to download to. |
parameters | Parameters. |
progress | Progress of a download in a human-readable format. |
requestBody | The content to send in a POST Request. |
responseBody | The content received if an output is not provided. |
ssl | Provide SSL Configuration. |
status | The return status. |
timeout | Timeout of requests in seconds. |
url | The URL to connect to. |
Example 1 | Get the content of a URL using a parameter. |
Example 2 | Basic Authentication. |
Example 3 | Download to a file. |
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
Provide Username/Password for Basic Authentication.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The request body to send or the response body received. This maps to
responseBody
as a convenience but is confusing
so should probably be deprecated.
Access | READ_ONLY |
Required | Read only. |
Content length of a response.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The content-type of a POST request. Useful for sending forms.
Access | READ_ONLY |
Required | Read only. |
The bytes downloaded so far. Only set for a stream download.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No defaults to GET. |
The request method. GET/POST. PUT and DELETE are not supported yet.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The name of the job. Can be any text.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
The output (such as a file) to download to.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
Parameters.
Access | READ_ONLY |
Required | Read only. |
Progress of a download in a human-readable format. Only set for a stream download.
Configured By | TEXT |
Access | READ_WRITE |
Required | No. |
The content to send in a POST Request.
Access | READ_ONLY |
Required | Read only. |
The content received if an output is not provided.
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
Provide SSL Configuration.
Access | READ_ONLY |
Required | Read Only. |
The return status.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
Timeout of requests in seconds.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The URL to connect to. Must be a full URL, e.g. http://www.google.com
Get the content of a URL using a parameter.
<oddjob> <job> <sequential> <jobs> <properties> <values> <value key="some.url" value="http://www.google.com/search"/> </values> </properties> <web:client id="request" url="${some.url}" xmlns:web="oddjob:web"> <parameters> <map> <values> <value key="q" value="gold fish"/> </values> </map> </parameters> </web:client> <echo>${request.content}</echo> </jobs> </sequential> </job> </oddjob>
Basic Authentication.
<oddjob id="oddjob"> <job> <web:client id="client" url="http://localhost:${server.port}" xmlns:web="oddjob:web"> <basicAuthentication> <is username="alice" password="secret"/> </basicAuthentication> </web:client> </job> </oddjob>
Download to a file.
<oddjob> <job> <sequential> <jobs> <properties> <values> <value key="some.url" value="http://ipv4.download.thinkbroadband.com/1GB.zip"/> <value key="some.file" value="download.zip"/> </values> </properties> <web:client id="request" name="Download Example" url="${some.url}" xmlns:web="oddjob:web"> <output> <file file="${some.file}"/> </output> </web:client> </jobs> </sequential> </job> </oddjob>