OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 class GetSpreadsheet { | |
6 | |
7 static void getSample(HTTPRequest req, HTTPResponse res) { | |
8 switch (req.method) { | |
9 case 'GET': | |
10 String name = req.queryParameters['name']; | |
11 res.writeString(new SYLKProducer().makeExample(name)); | |
12 res.writeDone(); | |
13 break; | |
14 case 'POST': | |
Dan Rice
2011/10/21 15:50:50
Note fallthrough
rchandia
2011/10/24 16:47:31
Done.
| |
15 default: | |
16 res.statusCode = HTTPStatus.METHOD_NOT_ALLOWED; | |
17 res.writeDone(); | |
18 break; | |
19 } | |
20 } | |
21 | |
22 static void listSamples(HTTPRequest req, HTTPResponse res) { | |
23 switch (req.method) { | |
24 case 'GET': | |
25 res.writeString(new SYLKProducer().listSamples()); | |
26 res.writeDone(); | |
27 break; | |
28 case 'POST': | |
29 | |
Dan Rice
2011/10/21 15:50:50
Remove blank line, note fallthrough
rchandia
2011/10/24 16:47:31
Done.
| |
30 default: | |
31 res.statusCode = HTTPStatus.METHOD_NOT_ALLOWED; | |
32 res.writeDone(); | |
33 break; | |
34 } | |
35 } | |
36 } | |
37 | |
38 | |
39 | |
OLD | NEW |