ResponseHandler implements IResponseHandler { public void onResponse(IHttpResponse response) throws IOException { status = response.getStatus(); ... } public void void onException(IOException ioe) { ... } }
711712713714715716717718719720721
IHttpRequest req = exchange.getRequest(); req.addHeader("X-Received", new Date().toString()); IHttpResponseHandler responseInterceptor = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { response.addHeader("X-Sent", new Date().toString()); exchange.send(response); }
740741742743744745746747748749750
this.shift = shift; } public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler responseInterceptor = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { if (response.hasBody()) {
855856857858859860861862863864865
String authtoken = authenticator.login(userPasswordPair[0], userPasswordPair[1]); request.removeHeader("Authorization"); request.setHeader("X-Authentication", authtoken); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
613614615616617618619620621622623
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()) {
703704705706707708709710711712713
732733734735736737738739740741742
847848849850851852853854855856857
5758596061626364656667
HttpServer server = new HttpServer(hdl); server.start(); HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort()); IHttpResponseHandler resHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { } public void onException(IOException ioe) {
919293949596979899100101
122123124125126127128129130131132