ResponseHandler implements IResponseHandler { public void onResponse(IHttpResponse response) throws IOException { status = response.getStatus(); ... } public void void onException(IOException ioe) { ... } }
7374757677787980818283
* {@inheritDoc} */ public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { @Execution(Execution.NONTHREADED) public void onResponse(IHttpResponse response) throws IOException { Map<String, List<String>> responseHeaders = new HashMap<String, List<String>>();
164165166167168169170171172173174
IHttpRequestHandler reqHdl = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException, BadMessageException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { IHttpResponse newResponse = new HttpResponse(response.getStatus(), response.getContentType(), response.getBody()); exchange.send(newResponse);
614615616617618619620621622623624
requestCopy.setHeader("If-Modified-Since", response.getHeader("Last-Modified")); } requestCopy.setAttribute(CacheHandler.SKIP_CACHE_HANDLING, "true"); IHttpResponseHandler respHdl = new IHttpResponseHandler() { @Execution(Execution.NONTHREADED) @InvokeOn(InvokeOn.MESSAGE_RECEIVED) public void onResponse(IHttpResponse response) throws IOException {
8182838485868788899091
public void onRequest(final IHttpExchange exchange) throws IOException { PostRequest newRequest = new PostRequest(exchange.getRequest().getRequestUrl().toString(), "text/plain", "Hello"); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
144145146147148149150151152153154
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
201202203204205206207208209210211
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { HttpResponse newResponse = new HttpResponse(200, "text/plain", "Hello You"); exchange.send(newResponse);
262263264265266267268269270271272
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { BodyDataSink bodyDataSink = exchange.send(new HttpResponseHeader(200, "text/plain")); bodyDataSink.write("Hello");
335336337338339340341342343344345
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { BodyDataSink bodyDataSink = exchange.send(new HttpResponseHeader(200, "text/plain"), 9); bodyDataSink.write("Hello");
538539540541542543544545546547548
request.removeHeader("Authorization"); request.setHeader("X-Authentication", authtoken); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
621622623624625626627628629630631
IHttpRequest req = exchange.getRequest(); requestString.append(req.getRequestHeader().toString()); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { // does request contain a body? if (response.hasBody()) {