| 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..0d7a1d7d01e18099c30f98fa67e624ca8b0a7874
|
| --- /dev/null
|
| +++ b/samples/total/src/GetSpreadsheet.dart
|
| @@ -0,0 +1,38 @@
|
| +// 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': // Fall through intended
|
| + 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': // Fall through intended
|
| + default:
|
| + res.statusCode = HTTPStatus.METHOD_NOT_ALLOWED;
|
| + res.writeDone();
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| +
|
|
|