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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 0e2dbb5a83a583dff1dfcf0d71270bf919acb17f..ae35cf91d8a063568ed35e5fa83f751a4b33d7bd 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -10573,7 +10573,8 @@ class HttpRequest extends EventTarget native "XMLHttpRequest" {
* 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>();
@@ -10591,6 +10592,16 @@ class HttpRequest extends EventTarget native "XMLHttpRequest" {
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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698