public interface HttpKit
HttpKit gives the you the basic functionality to interact with an
webserver over the http protocol.| Modifier and Type | Method and Description |
|---|---|
void |
addParserWriter(String mimeType,
ParserWriter<?> parser)
Adds a parser for the given mime type
|
void |
cancelAllOfOwner(Object owner)
Cancels all pending
HttpRequest that were tagged |
<T> void |
execute(HttpRequest request,
HttpResponseReceiver<T> receiver)
Executes a
HttpRequest with parsing the result according the
returned mime type. |
Cache<String,Object> |
getCache()
Get the cache that is uses
|
void |
removeParserWriter(String mimeType)
Removes the parser for the given mime type
|
void |
setCache(Cache<String,Object> cache)
Sets the internal cache
|
void |
setHttpExecutor(HttpExecutor httpExecutor)
Set the
HttpExecutor for async http data transfer |
void addParserWriter(String mimeType, ParserWriter<?> parser)
mimeType - The mimetype. The passed parser will be used for this mime
typeparser - The parservoid removeParserWriter(String mimeType)
mimeType - <T> void execute(HttpRequest request, HttpResponseReceiver<T> receiver)
HttpRequest with parsing the result according the
returned mime type. To make this work it's necessary, that the server
returns a correct mime type or was setted in the HttpRequest and
that a parser has been added to this HttpKit for the returned
mime typerequest - receiver - addParserWriter(String, ParserWriter)void setHttpExecutor(HttpExecutor httpExecutor)
HttpExecutor for async http data transferhttpExecutor - void cancelAllOfOwner(Object owner)
HttpRequest that were taggedowner - Copyright © 2015 Hannes Dorfmann. All rights reserved.