[Index]
web:client
Execute an HTTP client request.
This is a very simple wrapper around Jetty's
HTTPClient.
It was developed to support testing of Oddjob's web service and as such it is quite
limited. It only supports PUT and GET requests and has no support for authentication.
Property Summary
Example Summary
Example 1 |
Get the content of a URL using a parameter. |
Property Detail
content
Configured By | ATTRIBUTE |
Access | READ_WRITE |
contentType
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The content type of a POST request. Useful for sending forms.
method
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No defaults to GET. |
The request method. GET/POST.
name
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The name of the job. Can be any text.
parameters
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
Parameters.
requestBody
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The content retrieved or to send.
responseBody
Access | READ_ONLY |
Required | No. |
The content retrieved or to send.
status
Access | READ_ONLY |
Required | Read Only. |
The return status.
url
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The URL to connect to. Must be a full URL, e.g. http://www.google.com
Examples
Example 1
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>
(c) R Gordon Ltd 2005 - Present