public class DefaultRequestHandler extends Object implements RequestHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CHARACTER_ENCODING
The default and recommended character encoding.
|
| Constructor and Description |
|---|
DefaultRequestHandler()
Creates a new handler with UTF-8 character encoding.
|
DefaultRequestHandler(String characterEncoding)
Creates a new handler with the specified character encoding.
|
| Modifier and Type | Method and Description |
|---|---|
String |
get(String uri)
Returns the returned data at the specified URI.
|
String |
getCharacterEncoding()
Returns the character encoding used by this handler.
|
InputStream |
getInputStream(String uri)
Returns an InputStream from the specified URI.
|
String |
post(org.apache.http.client.methods.HttpPost data)
Posts new data to the server and returns the response as a string.
|
void |
setCharacterEncoding(String characterEncoding)
Sets the character encoding used by this handler.
|
public static final String DEFAULT_CHARACTER_ENCODING
public DefaultRequestHandler(String characterEncoding)
characterEncoding - to usepublic DefaultRequestHandler()
public String getCharacterEncoding()
getCharacterEncoding in interface RequestHandlerpublic void setCharacterEncoding(String characterEncoding)
setCharacterEncoding in interface RequestHandlercharacterEncoding - to usepublic InputStream getInputStream(String uri) throws IOException
RequestHandlergetInputStream in interface RequestHandleruri - to get input stream forIOExceptionpublic String get(String uri) throws IOException
RequestHandlerget in interface RequestHandleruri - to get string data atIOExceptionpublic String post(org.apache.http.client.methods.HttpPost data) throws IOException
RequestHandlerpost in interface RequestHandlerdata - to postIOExceptionCopyright © 2014–2015. All rights reserved.