Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 part of dart.io; | |
| 6 | |
| 7 | |
| 8 /** | |
| 9 * [:HttpMultipartFormData:] class used for 'upgrading' a [MimeMultipart] by | |
| 10 * parsing it as a 'multipart/form-data' part. The following code shows how | |
| 11 * it can be used. | |
|
Søren Gjesse
2013/05/06 13:46:34
What code?
Anders Johnsen
2013/05/06 14:07:55
Done.
| |
| 12 * | |
| 13 * | |
| 14 * [:HttpMultipartFormData:] is a Stream, serving either bytes or decoded | |
| 15 * Strings. Use [isText] or [isBinary] to see what type of data is provided. | |
| 16 */ | |
| 17 abstract class HttpMultipartFormData implements Stream { | |
| 18 /** | |
| 19 * The parsed [:Content-Type:] heaver of the [:HttpMultipartFormData:]. | |
|
Søren Gjesse
2013/05/06 13:46:34
heaver?
Anders Johnsen
2013/05/06 14:07:55
Done.
| |
| 20 * Returns [:null:] if not present. | |
| 21 */ | |
| 22 ContentType get contentType; | |
| 23 | |
| 24 /** | |
| 25 * The parsed [:Content-Disposition:] header of the [:HttpMultipartFormData:]. | |
| 26 * This field is always present. Use this extract e.g. name and filename | |
|
Søren Gjesse
2013/05/06 13:46:34
Use this -> Use this to
Søren Gjesse
2013/05/06 13:46:34
name -> name (form field name)
Søren Gjesse
2013/05/06 13:46:34
filename -> filename (client provided name of uplo
Anders Johnsen
2013/05/06 14:07:55
Done.
Anders Johnsen
2013/05/06 14:07:55
Done.
Anders Johnsen
2013/05/06 14:07:55
Done.
| |
| 27 * parameters. | |
| 28 */ | |
| 29 HeaderValue get contentDisposition; | |
| 30 | |
| 31 /** | |
| 32 * The parsed [:Content-Transfer-Encoding:] header of the | |
| 33 * [:HttpMultipartFormData:]. This field is used to determine how to decode | |
| 34 * the data. Returns [:null:] if not present. | |
| 35 */ | |
| 36 HeaderValue get contentTransferEncoding; | |
| 37 | |
| 38 /** | |
| 39 * Returns [:true:] if the data is decoded as [String]. | |
| 40 */ | |
| 41 bool get isText; | |
| 42 | |
| 43 /** | |
| 44 * Returns [:true:] if the data is raw bytes. | |
| 45 */ | |
| 46 bool get isBinary; | |
| 47 | |
| 48 /** | |
| 49 * Returns the value for the header named [name]. If there | |
| 50 * is no header with the provided name, [:null:] will be returned. | |
| 51 * | |
| 52 * Use this method to index other headers available in the original | |
| 53 * [MimeMultipart]. | |
| 54 */ | |
| 55 String value(String name); | |
| 56 | |
| 57 /** | |
| 58 * Parse a [MimeMultipart] and return a [HttpMultipartFormData]. If the | |
| 59 * [:Content-Disposition:] header is missing or invalid, a [HttpException] is | |
| 60 * thrown. | |
| 61 */ | |
| 62 static HttpMultipartFormData parse(MimeMultipart multipart) | |
| 63 => _HttpMultipartFormData.parse(multipart); | |
| 64 } | |
| OLD | NEW |