| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of http_server; |
| 6 | 6 |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * [HttpBodyHandler] is a helper class for processing and collecting | 9 * [HttpBodyHandler] is a helper class for processing and collecting |
| 10 * HTTP message data in an easy-to-use [HttpBody] object. The content | 10 * HTTP message data in an easy-to-use [HttpBody] object. The content |
| 11 * body is parsed, depending on the `Content-Type` header field. When | 11 * body is parsed, depending on the `Content-Type` header field. When |
| 12 * the full body is read and parsed the body content is made | 12 * the full body is read and parsed the body content is made |
| 13 * available. The class can be used to process both server requests | 13 * available. The class can be used to process both server requests |
| 14 * and client responses. | 14 * and client responses. |
| 15 * | 15 * |
| 16 * The following content types are recognized: | 16 * The following content types are recognized: |
| 17 * | 17 * |
| 18 * text/* | 18 * text/ * |
| 19 * application/json | 19 * application/json |
| 20 * application/x-www-form-urlencoded | 20 * application/x-www-form-urlencoded |
| 21 * multipart/form-data | 21 * multipart/form-data |
| 22 * | 22 * |
| 23 * For content type `text/\*` the body is decoded into a string. The | 23 * For content type `text/\*` the body is decoded into a string. The |
| 24 * 'charset' parameter of the content type specifies the encoding | 24 * 'charset' parameter of the content type specifies the encoding |
| 25 * used for decoding. If no 'charset' is present the default encoding | 25 * used for decoding. If no 'charset' is present the default encoding |
| 26 * of ISO-8859-1 is used. | 26 * of ISO-8859-1 is used. |
| 27 * | 27 * |
| 28 * For content type `application/json` the body is decoded into a | 28 * For content type `application/json` the body is decoded into a |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 * The [ContentType] of the uploaded file. For 'text/\*' and | 197 * The [ContentType] of the uploaded file. For 'text/\*' and |
| 198 * 'application/json' the [data] field will a String. | 198 * 'application/json' the [data] field will a String. |
| 199 */ | 199 */ |
| 200 ContentType get contentType; | 200 ContentType get contentType; |
| 201 | 201 |
| 202 /** | 202 /** |
| 203 * The content of the file. Either a [String] or a [List<int>]. | 203 * The content of the file. Either a [String] or a [List<int>]. |
| 204 */ | 204 */ |
| 205 dynamic get content; | 205 dynamic get content; |
| 206 } | 206 } |
| OLD | NEW |