Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: sdk/lib/io/http_body.dart

Issue 14865008: Extend HttpBody handler to support 'multipart/form-data'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix interface. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/io/http_body_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 dart.io; 5 part of dart.io;
6 6
7 7
8 /** 8 /**
9 * [HttpBodyHandler] is a helper class for parsing and collecting HTTP message 9 * [HttpBodyHandler] is a helper class for parsing and collecting HTTP message
10 * data in an easy-to-use [HttpBody] object. The content body is parsed, 10 * data in an easy-to-use [HttpBody] object. The content body is parsed,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 /** 68 /**
69 * A HTTP content body produced by [HttpBodyHandler] for either [HttpRequest] 69 * A HTTP content body produced by [HttpBodyHandler] for either [HttpRequest]
70 * or [HttpClientResponse]. 70 * or [HttpClientResponse].
71 */ 71 */
72 abstract class HttpBody { 72 abstract class HttpBody {
73 /** 73 /**
74 * The content type e.g. application/json, application/octet-stream, 74 * The content type e.g. application/json, application/octet-stream,
75 * application/x-www-form-urlencoded, text/plain. 75 * application/x-www-form-urlencoded, text/plain.
76 */ 76 */
77 String get mimeType; 77 ContentType get contentType;
78 78
79 /** 79 /**
80 * A high-level type value, that reflects how the body was parsed, e.g. 80 * A high-level type value, that reflects how the body was parsed, e.g.
81 * "text", "binary" and "json". 81 * "text", "binary" and "json".
82 */ 82 */
83 String get type; 83 String get type;
84 84
85 /** 85 /**
86 * The actual body. The type depends on [type]. 86 * The actual body. The type depends on [type].
87 */ 87 */
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 /** 136 /**
137 * Returns the request headers. 137 * Returns the request headers.
138 */ 138 */
139 HttpHeaders get headers; 139 HttpHeaders get headers;
140 140
141 /** 141 /**
142 * The [HttpResponse] used for responding to the client. 142 * The [HttpResponse] used for responding to the client.
143 */ 143 */
144 HttpResponse get response; 144 HttpResponse get response;
145 } 145 }
146
147
148 /**
149 * A [HttpBodyFileUpload] object wraps a file upload, presenting a way for
150 * extracting filename, contentType and the data of the uploaded file.
151 */
152 abstract class HttpBodyFileUpload {
153 /**
154 * The filename of the uploaded file.
155 */
156 String filename;
157
158 /**
159 * The [ContentType] of the uploaded file. For 'text/\*' and
160 * 'application/json' the [data] field will a String.
161 */
162 ContentType contentType;
163
164 /**
165 * The content of the file. Either a [String] or a [List<int>].
166 */
167 dynamic content;
168 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/io/http_body_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698