[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

content  
contentType The content type of a POST request.
method The request method.
name The name of the job.
parameters Parameters.
requestBody The content retrieved or to send.
responseBody The content retrieved or to send.
status The return status.
url The URL to connect to.

Example Summary

Example 1 Get the content of a URL using a parameter.

Property Detail

content

Configured ByATTRIBUTE
AccessREAD_WRITE

contentType

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The content type of a POST request. Useful for sending forms.

method

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo defaults to GET.

The request method. GET/POST.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of the job. Can be any text.

parameters

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

Parameters.

requestBody

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The content retrieved or to send.

responseBody

AccessREAD_ONLY
RequiredNo.

The content retrieved or to send.

status

AccessREAD_ONLY
RequiredRead Only.

The return status.

url

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes.

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