I\'ve been trying to write the beginnings of a simple web server, but can\'t seem to get the response to get sent. I\'ve tried every type of Output stream imaginable but no
Try pass the date.
String res = "HTTP/1.0 200 OK\n"
+ "Server: HTTP server/0.1\n";
+ "Date: "+format.format(new java.util.Date())+"\n";
+ "Content-type: text/html; charset=UTF-8\n";
+ "Content-Length: 38\n\n";
+ "OK";
out.write(res.getBytes());
out.flush();
private SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:Ss z");