com.softwareag.connectivity.httpclient
Event FormRequest


The event wraps a Request to support HTML form encoding.

It expects a dictionary payload to encode to either "multipart/form-data" or "application/x-www-form-urlencoded" content types. 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.

Example:
dictionary payload := {"foo":"bar", "abc":"def"};
        
HttpOptions httpOptions := new HttpOptions;
httpOptions.headers["content-type"] := "application/x-www-form-urlencoded";
FormRequest(transport.createRequest(RequestType.POST, "/", payload, httpOptions), new dictionary).execute(handleResponse);
See Also:
com.softwareag.connectivity.httpclient.Request - 
Sends:
com.softwareag.connectivity.httpclient.FormRequest - 
Listens:
com.softwareag.connectivity.httpclient.Response - 

Member summary
 com.softwareag.connectivity.httpclient.Requestrequest

The wrapped Request event.
 dictionary<stringdictionary<stringstring>>formMetadata

The form metadata for requests with content-type "multipart/form-data". Empty for "application/x-www-form-urlencoded".
 
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.
 
Member detail

formMetadata

            dictionary<stringdictionary<stringstring>> formMetadata
        
The form metadata for requests with content-type "multipart/form-data". Empty for "application/x-www-form-urlencoded".

request

            com.softwareag.connectivity.httpclient.Request request
        
The wrapped Request event.
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.FormRequest - 
Listens:
com.softwareag.connectivity.httpclient.Response -