| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of http_server; | 5 library http_server.http_multipart_form_data; |
| 6 | 6 |
| 7 import 'dart:async'; |
| 8 import 'dart:convert'; |
| 9 import 'dart:io'; |
| 10 |
| 11 import 'package:mime/mime.dart'; |
| 12 |
| 13 import 'http_multipart_form_data_impl.dart'; |
| 7 | 14 |
| 8 /** | 15 /** |
| 9 * [:HttpMultipartFormData:] class used for 'upgrading' a [MimeMultipart] by | 16 * [:HttpMultipartFormData:] class used for 'upgrading' a [MimeMultipart] by |
| 10 * parsing it as a 'multipart/form-data' part. The following code shows how | 17 * parsing it as a 'multipart/form-data' part. The following code shows how |
| 11 * it can be used. | 18 * it can be used. |
| 12 * | 19 * |
| 13 * HttpServer server = ...; | 20 * HttpServer server = ...; |
| 14 * server.listen((request) { | 21 * server.listen((request) { |
| 15 * String boundary = request.headers.contentType.parameters['boundary']; | 22 * String boundary = request.headers.contentType.parameters['boundary']; |
| 16 * request | 23 * request |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 * thrown. | 76 * thrown. |
| 70 * | 77 * |
| 71 * If the [MimeMultipart] is identified as text, and the [:Content-Type:] | 78 * If the [MimeMultipart] is identified as text, and the [:Content-Type:] |
| 72 * header is missing, the data is decoded using [defaultEncoding]. See more | 79 * header is missing, the data is decoded using [defaultEncoding]. See more |
| 73 * information in the | 80 * information in the |
| 74 * [HTML5 spec](http://dev.w3.org/html5/spec-preview/ | 81 * [HTML5 spec](http://dev.w3.org/html5/spec-preview/ |
| 75 * constraints.html#multipart-form-data). | 82 * constraints.html#multipart-form-data). |
| 76 */ | 83 */ |
| 77 static HttpMultipartFormData parse(MimeMultipart multipart, | 84 static HttpMultipartFormData parse(MimeMultipart multipart, |
| 78 {Encoding defaultEncoding: UTF8}) | 85 {Encoding defaultEncoding: UTF8}) |
| 79 => _HttpMultipartFormData.parse(multipart, defaultEncoding); | 86 => HttpMultipartFormDataImpl.parse(multipart, defaultEncoding); |
| 80 } | 87 } |
| OLD | NEW |