com.github.fedorchuck.developers_notification.http
Class HttpClient

java.lang.Object
  extended by com.github.fedorchuck.developers_notification.http.HttpClient

public class HttpClient
extends java.lang.Object

A HTTP client. It allows you to make requests to HTTP servers, and a single client can make requests to any server.

Author: Volodymyr Fedorchuk

Since:
0.1.0

Constructor Summary
HttpClient()
           
 
Method Summary
 HttpResponse get(java.lang.String stringUrl, java.util.Map<java.lang.String,java.lang.String> arguments)
          Creates an HTTP GET request to send to the server at the specified URL, specifying a response handler to receive the response
 HttpResponse post(java.lang.String stringUrl, java.lang.String json)
          Creates an HTTP POST request to send to the server at the specified url, specifying json to receive the response
 HttpResponse sendMultipartFromData(java.lang.String stringUrl, org.apache.http.entity.mime.MultipartEntityBuilder builder)
          Creates an HTTP POST request to send to the server at the specified url, specifying MultipartEntityBuilder to receive the response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClient

public HttpClient()
Method Detail

get

public HttpResponse get(java.lang.String stringUrl,
                        java.util.Map<java.lang.String,java.lang.String> arguments)
                 throws java.io.IOException
Creates an HTTP GET request to send to the server at the specified URL, specifying a response handler to receive the response

Parameters:
stringUrl - the url
arguments - of url
Returns:
an HTTP response as HttpResponse
Throws:
java.io.IOException - if an I/O error occurs
Since:
0.1.0

post

public HttpResponse post(java.lang.String stringUrl,
                         java.lang.String json)
                  throws java.io.IOException
Creates an HTTP POST request to send to the server at the specified url, specifying json to receive the response

Parameters:
stringUrl - the url
json - for request
Returns:
an HTTP response as HttpResponse
Throws:
java.io.IOException - if an I/O error occurs
Since:
0.1.0

sendMultipartFromData

public HttpResponse sendMultipartFromData(java.lang.String stringUrl,
                                          org.apache.http.entity.mime.MultipartEntityBuilder builder)
                                   throws java.io.IOException
Creates an HTTP POST request to send to the server at the specified url, specifying MultipartEntityBuilder to receive the response

Parameters:
stringUrl - the url
builder - for request
Returns:
an HTTP response as HttpResponse
Throws:
java.io.IOException - if an I/O error occurs
Since:
0.3.0