com.softwareag.connectivity.httpclient
Event Request


An event representing an HTTP request. It should be created using the HttpTransport event.

To perform the request use the execute action. This sends the event to an appropriate HTTP transport, which performs the HTTP request and returns the response.

The event FormRequest must be used for HTTP requests with "multipart/form-data" or "application/x-www-form-urlencoded" as content types.
See Also:
com.softwareag.connectivity.httpclient.FormRequest - 
Sends:
com.softwareag.connectivity.httpclient.Request - 
Listens:
com.softwareag.connectivity.httpclient.Response - 

Member summary
 stringmethod

The HTTP method to use for the request.
 stringpath

The request URI.
 anypayload

The request payload.
 com.softwareag.connectivity.httpclient.HttpOptionsoptions

Optional HTTP options to set headers, cookies and query parameters.
 
Action summary
 voidexecute(action<com.softwareag.connectivity.httpclient.Response> responseHandler)

Send the request to an appropriate HTTP client transport chain instance and execute the callback on the response which could be either success or failure.
 voidexecuteWithSeparateCallbacks(action<com.softwareag.connectivity.httpclient.Response> success, action<com.softwareag.connectivity.httpclient.Response> failure)

Send the request to an appropriate HTTP client transport chain instance and execute the appropriate callback on the response.
 stringgetCookie(string name)

Return the value of the HTTP cookie with the specified name. This is equivalent to calling options.cookies[name].
 stringgetHeader(string name)

Return the value of the HTTP header with the specified name. This is equivalent to calling options.headers[name].
 stringgetQueryParameter(string name)

Return the value of the HTTP query parameter with the specified name. This is equivalent to calling options.queryParams[name].
 voidsetCookie(string name, string value)

Set an HTTP cookie in the request. This is equivalent to options.cookies[name] := value.
 voidsetHeader(string name, string value)

Set an HTTP header. This is equivalent to options.headers[name] := value.
 voidsetQueryParameter(string name, string value)

Set an HTTP query parameter which gets encoded as part of the path in the request URI. This is equivalent to options.queryParams[name] := value.
 
Member detail

method

            string method
        
The HTTP method to use for the request.
See Also:
com.softwareag.connectivity.httpclient.RequestType - 

options

            com.softwareag.connectivity.httpclient.HttpOptions options
        
Optional HTTP options to set headers, cookies and query parameters.

path

            string path
        
The request URI.

payload

            any payload
        
The request payload.
Action detail

execute

            void execute(action<com.softwareag.connectivity.httpclient.Response> responseHandler)
        
Send the request to an appropriate HTTP client transport chain instance and execute the callback on the response which could be either success or failure.
Parameters:
responseHandler - The callback action to handle the response.

executeWithSeparateCallbacks

            void executeWithSeparateCallbacks(action<com.softwareag.connectivity.httpclient.Response> success, action<com.softwareag.connectivity.httpclient.Response> failure)
        
Send the request to an appropriate HTTP client transport chain instance and execute the appropriate callback on the response.
Parameters:
success - The callback action to handle the success response.
failure - The callback action to handle the failure response.
Sends:
com.softwareag.connectivity.httpclient.Request - 
Listens:
com.softwareag.connectivity.httpclient.Response - 

getCookie

            string getCookie(string name)
        
Return the value of the HTTP cookie with the specified name. This is equivalent to calling options.cookies[name].
Parameters:
name - The name of the cookie.
Returns:
The value of the cookie.
Throws:
Throws IllegalArgumentException if the cookie is not set.

getHeader

            string getHeader(string name)
        
Return the value of the HTTP header with the specified name. This is equivalent to calling options.headers[name].
Parameters:
name - The name of the header.
Returns:
The value of the header.
Throws:
Throws IllegalArgumentException if the header is not set.

getQueryParameter

            string getQueryParameter(string name)
        
Return the value of the HTTP query parameter with the specified name. This is equivalent to calling options.queryParams[name].
Parameters:
name - The name of the parameter.
Returns:
The value of the parameter.
Throws:
Throws IllegalArgumentException if the parameter is not set.

setCookie

            void setCookie(string name, string value)
        
Set an HTTP cookie in the request. This is equivalent to options.cookies[name] := value.

For details about HTTP cookies, see "Dealing with cookies" under "The HTTP Client Transport Connectivity Plug-in" in "Connecting Apama Applications to External Components".
Parameters:
name - The name of the cookie.
value - The value of the cookie.

setHeader

            void setHeader(string name, string value)
        
Set an HTTP header. This is equivalent to options.headers[name] := value.

For details about HTTP headers, see "Handling HTTP headers" under "The HTTP Client Transport Connectivity Plug-in" in "Connecting Apama Applications to External Components".
Parameters:
name - The name of the header.
value - The value of the header.

setQueryParameter

            void setQueryParameter(string name, string value)
        
Set an HTTP query parameter which gets encoded as part of the path in the request URI. This is equivalent to options.queryParams[name] := value.
Parameters:
name - The name of the parameter.
value - The value of the parameter.