public class HTTPClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static be.panako.http.ResponseHandler |
printResponseHandler |
Constructor and Description |
---|
HTTPClient() |
Modifier and Type | Method and Description |
---|---|
void |
get(java.lang.String url,
be.panako.http.ResponseHandler handler)
Send a HTTP get request to an url.
|
void |
post(java.lang.String url,
java.lang.String body,
be.panako.http.ResponseHandler handler)
Sends a POST request to a server.
|
public void get(java.lang.String url, be.panako.http.ResponseHandler handler) throws java.io.IOException
url
- The url.handler
- To handle the response you need a handler.java.io.IOException
- When the server can not be found.public void post(java.lang.String url, java.lang.String body, be.panako.http.ResponseHandler handler) throws java.io.IOException
url
- The URL to POST to.body
- the body of the post request. This can contain parameters.handler
- The handler to handle the response from the server.java.io.IOException
- when communication goes wrong.