Mercurial Hosting > luan
comparison src/goodjava/webserver/examples/Params.java @ 1607:fa066aaa068c
nginx caching
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 30 Apr 2021 20:23:28 -0600 |
parents | 27efb1fcbcb5 |
children |
comparison
equal
deleted
inserted
replaced
1606:7c7f28c724e8 | 1607:fa066aaa068c |
---|---|
12 | 12 |
13 public final class Params implements Handler { | 13 public final class Params implements Handler { |
14 | 14 |
15 public Response handle(Request request) { | 15 public Response handle(Request request) { |
16 Response response = new Response(); | 16 Response response = new Response(); |
17 response.headers.put( "content-type", "text/plain; charset=utf-8" ); | 17 response.headers.put( "Content-Type", "text/plain; charset=utf-8" ); |
18 try { | 18 try { |
19 Writer writer = new OutputStreamWriter( new ResponseOutputStream(response) ); | 19 Writer writer = new OutputStreamWriter( new ResponseOutputStream(response) ); |
20 for( Map.Entry<String,Object> entry : request.parameters.entrySet() ) { | 20 for( Map.Entry<String,Object> entry : request.parameters.entrySet() ) { |
21 writer.write(entry.getKey()+" = "+entry.getValue()+"\n"); | 21 writer.write(entry.getKey()+" = "+entry.getValue()+"\n"); |
22 } | 22 } |