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

Side by Side Diff: tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate

Issue 891583002: Add type annotations to some dart:html closures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | 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) 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 /** 7 /**
8 * A client-side XHR request for getting data from a URL, 8 * A client-side XHR request for getting data from a URL,
9 * formally known as XMLHttpRequest. 9 * formally known as XMLHttpRequest.
10 * 10 *
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 * // Do something with the response. 73 * // Do something with the response.
74 * }); 74 * });
75 * 75 *
76 * See also: 76 * See also:
77 * 77 *
78 * * [request] 78 * * [request]
79 */ 79 */
80 static Future<String> getString(String url, 80 static Future<String> getString(String url,
81 {bool withCredentials, void onProgress(ProgressEvent e)}) { 81 {bool withCredentials, void onProgress(ProgressEvent e)}) {
82 return request(url, withCredentials: withCredentials, 82 return request(url, withCredentials: withCredentials,
83 onProgress: onProgress).then((xhr) => xhr.responseText); 83 onProgress: onProgress).then((HttpRequest xhr) => xhr.responseText);
84 } 84 }
85 85
86 /** 86 /**
87 * Makes a server POST request with the specified data encoded as form data. 87 * Makes a server POST request with the specified data encoded as form data.
88 * 88 *
89 * This is roughly the POST equivalent of getString. This method is similar 89 * This is roughly the POST equivalent of getString. This method is similar
90 * to sending a FormData object with broader browser support but limited to 90 * to sending a FormData object with broader browser support but limited to
91 * String values. 91 * String values.
92 * 92 *
93 * If [data] is supplied, the key/value pairs are URI encoded with 93 * If [data] is supplied, the key/value pairs are URI encoded with
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 headers[key] = '${headers[key]}, $value'; 371 headers[key] = '${headers[key]}, $value';
372 } else { 372 } else {
373 headers[key] = value; 373 headers[key] = value;
374 } 374 }
375 } 375 }
376 return headers; 376 return headers;
377 } 377 }
378 378
379 $!MEMBERS 379 $!MEMBERS
380 } 380 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698