|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.hsr.bieridee.test.http.HttpHelper
public final class HttpHelper
A helper class that simplifies HTTP requests. It supports request processors that can be added with addRequestProcessor.
Constructor Summary | |
---|---|
HttpHelper()
|
Method Summary | |
---|---|
void |
addRequestProcessor(IRequestProcessor requestProcessor)
Add a request processor. |
org.apache.http.HttpResponse |
delete(java.lang.String uri)
Perform a DELETE request. |
org.apache.http.HttpResponse |
get(java.lang.String uri)
Perform a GET request. |
org.apache.http.HttpResponse |
post(java.lang.String uri)
Perform a POST request without body data. |
org.apache.http.HttpResponse |
post(java.lang.String uri,
org.apache.http.entity.AbstractHttpEntity data,
java.lang.String contentType)
Perform a POST request with attached entity. |
org.apache.http.HttpResponse |
post(java.lang.String uri,
org.json.JSONObject data)
Perform a POST request with attached JSONObject entity. |
org.apache.http.HttpResponse |
put(java.lang.String uri)
Perform a PUT request without body data. |
org.apache.http.HttpResponse |
put(java.lang.String uri,
org.apache.http.entity.AbstractHttpEntity data,
java.lang.String contentType)
Perform a PUT request with attached entity. |
org.apache.http.HttpResponse |
put(java.lang.String uri,
org.json.JSONObject data)
Perform a PUT request with attached JSONObject entity. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpHelper()
Method Detail |
---|
public void addRequestProcessor(IRequestProcessor requestProcessor)
requestProcessor
- A subclass of IRequestProcessorpublic org.apache.http.HttpResponse get(java.lang.String uri)
uri
- Full URI of the server resource
public org.apache.http.HttpResponse post(java.lang.String uri)
uri
- Full URI of the server resource
public org.apache.http.HttpResponse post(java.lang.String uri, org.json.JSONObject data) throws org.json.JSONException, java.io.UnsupportedEncodingException
uri
- Full URI of the server resourcedata
- A NameValuePair array containing
org.json.JSONException
java.io.UnsupportedEncodingException
public org.apache.http.HttpResponse post(java.lang.String uri, org.apache.http.entity.AbstractHttpEntity data, java.lang.String contentType)
uri
- Full URI of the server resourcedata
- A NameValuePair array containingcontentType
- The Content-type string
public org.apache.http.HttpResponse put(java.lang.String uri)
uri
- Full URI of the server resource
public org.apache.http.HttpResponse put(java.lang.String uri, org.json.JSONObject data) throws org.json.JSONException, java.io.UnsupportedEncodingException
uri
- Full URI of the server resourcedata
- A NameValuePair array containing
org.json.JSONException
java.io.UnsupportedEncodingException
public org.apache.http.HttpResponse put(java.lang.String uri, org.apache.http.entity.AbstractHttpEntity data, java.lang.String contentType)
uri
- Full URI of the server resourcedata
- A NameValuePair array containingcontentType
- The Content-type string
public org.apache.http.HttpResponse delete(java.lang.String uri)
uri
- Full URI of the server resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |