comparison src/luan/webserver/examples/Example.java @ 1148:49fb4e83484f

webserver - change headers to lower case
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 04 Feb 2018 17:11:06 -0700
parents 2dda3c92a473
children 668f29bc52ea
comparison
equal deleted inserted replaced
1147:30d87b7d1d62 1148:49fb4e83484f
23 23
24 public class Example implements Handler { 24 public class Example implements Handler {
25 25
26 public Response handle(Request request) { 26 public Response handle(Request request) {
27 Response response = new Response(); 27 Response response = new Response();
28 response.headers.put( "Content-Type", "text/plain; charset=UTF-8" ); 28 response.headers.put( "content-type", "text/plain; charset=UTF-8" );
29 try { 29 try {
30 Writer writer = new OutputStreamWriter( new ResponseOutputStream(response) ); 30 Writer writer = new OutputStreamWriter( new ResponseOutputStream(response) );
31 writer.write("Hello World\n"); 31 writer.write("Hello World\n");
32 writer.close(); 32 writer.close();
33 } catch(IOException e) { 33 } catch(IOException e) {