@Override public void handle(HttpExchange httpExchange) throws IOException { if (HttpTransportConstants.METHOD_POST.equals(httpExchange.getRequestMethod())) { HttpExchangeConnection connection = new HttpExchangeConnection(httpExchange); connection.setChunkedEncoding(chunkedEncoding); try { handleConnection(connection); } catch (Exception ex) { logger.error(ex); } } else { httpExchange.sendResponseHeaders(HttpTransportConstants.STATUS_METHOD_NOT_ALLOWED, -1); httpExchange.close(); } } }
@Override public void handle(HttpExchange httpExchange) throws IOException { if (HttpTransportConstants.METHOD_POST.equals(httpExchange.getRequestMethod())) { HttpExchangeConnection connection = new HttpExchangeConnection(httpExchange); connection.setChunkedEncoding(chunkedEncoding); try { handleConnection(connection); } catch (Exception ex) { logger.error(ex); } } else { httpExchange.sendResponseHeaders(HttpTransportConstants.STATUS_METHOD_NOT_ALLOWED, -1); httpExchange.close(); } } }
@Override public void handle(HttpExchange httpExchange) throws IOException { if (HttpTransportConstants.METHOD_POST.equals(httpExchange.getRequestMethod())) { HttpExchangeConnection connection = new HttpExchangeConnection(httpExchange); connection.setChunkedEncoding(chunkedEncoding); try { handleConnection(connection); } catch (Exception ex) { logger.error(ex); } } else { httpExchange.sendResponseHeaders(HttpTransportConstants.STATUS_METHOD_NOT_ALLOWED, -1); httpExchange.close(); } } }