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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 14752025: Adding ability to specify request headers and mime type for Future-based XHRs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/xhr_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index e549cb6acde4e335620102c0ab365e8f48665f29..7b67f9a2a851acebfc9c390b0cb840d801c89057 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -10983,7 +10983,8 @@ class HttpRequest extends EventTarget {
* See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
*/
static Future<HttpRequest> request(String url,
- {String method, bool withCredentials, String responseType, sendData,
+ {String method, bool withCredentials, String responseType,
+ String mimeType, Map<String, String> requestHeaders, sendData,
void onProgress(ProgressEvent e)}) {
var completer = new Completer<HttpRequest>();
@@ -11001,6 +11002,16 @@ class HttpRequest extends EventTarget {
xhr.responseType = responseType;
}
+ if (mimeType != null) {
+ xhr.overrideMimeType(mimeType);
+ }
+
+ if (requestHeaders != null) {
+ requestHeaders.forEach((header, value) {
+ xhr.setRequestHeader(header, value);
+ });
+ }
+
if (onProgress != null) {
xhr.onProgress.listen(onProgress);
}
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/xhr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698