org.lastbamboo.common.http.client
Class HttpClientPostRequester

java.lang.Object
  extended by org.lastbamboo.common.http.client.HttpClientPostRequester
All Implemented Interfaces:
HttpClientRequester

public class HttpClientPostRequester
extends Object
implements HttpClientRequester

Issues a post request using HTTP client.


Constructor Summary
HttpClientPostRequester()
           
 
Method Summary
 String request(String url)
          Issue a request with no parameters.
 String request(String baseUrl, Collection<org.littleshoot.util.Pair<String,String>> parameters)
          Writes a request to the specified address.
 String request(String baseUrl, Map<String,String> parameters)
          Writes a request to the specified address.
 String request(URL url)
          Issue a request with no parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientPostRequester

public HttpClientPostRequester()
Method Detail

request

public String request(String baseUrl,
                      Collection<org.littleshoot.util.Pair<String,String>> parameters)
               throws IOException,
                      ServiceUnavailableException
Description copied from interface: HttpClientRequester
Writes a request to the specified address.

Specified by:
request in interface HttpClientRequester
Parameters:
baseUrl - The base URL to send the request to.
parameters - The request parameters.
Returns:
The response body.
Throws:
IOException - If an IO error occurs.
ServiceUnavailableException - If the service is unavailable.

request

public String request(String baseUrl,
                      Map<String,String> parameters)
               throws IOException,
                      ServiceUnavailableException
Description copied from interface: HttpClientRequester
Writes a request to the specified address.

Specified by:
request in interface HttpClientRequester
Parameters:
baseUrl - The base URL to send the request to.
parameters - The request parameters.
Returns:
The response body.
Throws:
IOException - If an IO error occurs.
ServiceUnavailableException - If the service is unavailable.

request

public String request(String url)
               throws IOException,
                      ServiceUnavailableException
Description copied from interface: HttpClientRequester
Issue a request with no parameters.

Specified by:
request in interface HttpClientRequester
Parameters:
url - The URL to issue the request to.
Returns:
The response body.
Throws:
IOException - If an IO error occurs.
ServiceUnavailableException - If the service is unavailable.

request

public String request(URL url)
               throws IOException,
                      ServiceUnavailableException
Description copied from interface: HttpClientRequester
Issue a request with no parameters.

Specified by:
request in interface HttpClientRequester
Parameters:
url - The URL to issue the request to.
Returns:
The response body.
Throws:
IOException - If any IO error occurs.
ServiceUnavailableException - If the service is unavailable.


Copyright © 2013 LittleShoot. All Rights Reserved.