com.dtolabs.client.utils
Interface BaseHttpClient

All Superinterfaces:
ServerResponse
All Known Subinterfaces:
WebserviceHttpClient

public interface BaseHttpClient
extends ServerResponse

BaseHttpClient provides a simple interface for making and receiving HTTP requests to the server. Instances are obtained via the WebserviceHttpClientFactory.


Method Summary
 int getContentLengthRetrieved()
          Return the content length retrieved
 org.apache.commons.httpclient.HttpMethod getRequestMethod()
          Returns the HttpMethod used for the request.
 void makeRequest()
          Makes the HTTP request to workbench.
 void setMethodType(java.lang.String method)
          Set the HTTP method.
 void setRequestHeader(java.lang.String name, java.lang.String value)
          Set a Header field for the request.
 
Methods inherited from interface com.dtolabs.client.utils.ServerResponse
getResponseBody, getResultContentType, getResultStream
 

Method Detail

setRequestHeader

void setRequestHeader(java.lang.String name,
                      java.lang.String value)
Set a Header field for the request. Must be made before makeRequest is called.


makeRequest

void makeRequest()
                 throws java.io.IOException,
                        HttpClientException
Makes the HTTP request to workbench.

Throws:
java.io.IOException
HttpClientException

getRequestMethod

org.apache.commons.httpclient.HttpMethod getRequestMethod()
Returns the HttpMethod used for the request. Will return null before makeRequest is called.

Returns:
the HttpMethod instance used for the request.

getContentLengthRetrieved

int getContentLengthRetrieved()
Return the content length retrieved

Returns:
content length

setMethodType

void setMethodType(java.lang.String method)
Set the HTTP method. Default is GET, and POST will be automatically set if isPostRequest() returns true.

Parameters:
method - GET/POST/PUT/DELETE