示例#1
0
 void okReply(HttpTransaction req) throws IOException {
   req.setResponseEntityBody("Hello .");
   req.sendResponse(200, "Ok");
   req.orderlyClose();
 }
示例#2
0
 void errorReply(HttpTransaction req, String reply) throws IOException {
   req.addResponseHeader("Connection", "close");
   req.addResponseHeader("Www-authenticate", reply);
   req.sendResponse(401, "Unauthorized");
   req.orderlyClose();
 }