Chromium Code Reviews| Index: samples/total/src/GetSpreadsheet.dart |
| diff --git a/samples/total/src/GetSpreadsheet.dart b/samples/total/src/GetSpreadsheet.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a14c5b1d229e5c2efaf8033bb08214d2d5b2ae82 |
| --- /dev/null |
| +++ b/samples/total/src/GetSpreadsheet.dart |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +class GetSpreadsheet { |
| + |
| + static void getSample(HTTPRequest req, HTTPResponse res) { |
| + switch (req.method) { |
| + case 'GET': |
| + String name = req.queryParameters['name']; |
| + res.writeString(new SYLKProducer().makeExample(name)); |
| + res.writeDone(); |
| + break; |
| + case 'POST': |
|
Dan Rice
2011/10/21 15:50:50
Note fallthrough
rchandia
2011/10/24 16:47:31
Done.
|
| + default: |
| + res.statusCode = HTTPStatus.METHOD_NOT_ALLOWED; |
| + res.writeDone(); |
| + break; |
| + } |
| + } |
| + |
| + static void listSamples(HTTPRequest req, HTTPResponse res) { |
| + switch (req.method) { |
| + case 'GET': |
| + res.writeString(new SYLKProducer().listSamples()); |
| + res.writeDone(); |
| + break; |
| + case 'POST': |
| + |
|
Dan Rice
2011/10/21 15:50:50
Remove blank line, note fallthrough
rchandia
2011/10/24 16:47:31
Done.
|
| + default: |
| + res.statusCode = HTTPStatus.METHOD_NOT_ALLOWED; |
| + res.writeDone(); |
| + break; |
| + } |
| + } |
| +} |
| + |
| + |
| + |