com.softwareag.connectivity.httpclient
Event Request


The event for the HTTP requests. It should be created using the HttpTransport event.

The execute action should be used for executing the request which 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)

Returns an HTTP cookie set in the request. This is equivalent to calling options.cookies[name].
 stringgetHeader(string name)

Returns an HTTP header set in this request. This is equivalent to calling options.headers[name].
 stringgetQueryParameter(string name)

Returns an HTTP query parameter set in this request. 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)
        
Returns an HTTP cookie set in the request. 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)
        
Returns an HTTP header set in this request. 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)
        
Returns an HTTP query parameter set in this request. 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.
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.
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.