| OLD | NEW |
| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 responseType: responseType, | 130 responseType: responseType, |
| 131 requestHeaders: requestHeaders, sendData: formData, | 131 requestHeaders: requestHeaders, sendData: formData, |
| 132 onProgress: onProgress); | 132 onProgress: onProgress); |
| 133 } | 133 } |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * Creates and sends a URL request for the specified [url]. | 136 * Creates and sends a URL request for the specified [url]. |
| 137 * | 137 * |
| 138 * By default `request` will perform an HTTP GET request, but a different | 138 * By default `request` will perform an HTTP GET request, but a different |
| 139 * method (`POST`, `PUT`, `DELETE`, etc) can be used by specifying the | 139 * method (`POST`, `PUT`, `DELETE`, etc) can be used by specifying the |
| 140 * [method] parameter. | 140 * [method] parameter. (See also [HttpRequest.postFormData] for `POST` |
| 141 * requests only. |
| 141 * | 142 * |
| 142 * The Future is completed when the response is available. | 143 * The Future is completed when the response is available. |
| 143 * | 144 * |
| 144 * If specified, `sendData` will send data in the form of a [ByteBuffer], | 145 * If specified, `sendData` will send data in the form of a [ByteBuffer], |
| 145 * [Blob], [Document], [String], or [FormData] along with the HttpRequest. | 146 * [Blob], [Document], [String], or [FormData] along with the HttpRequest. |
| 146 * | 147 * |
| 148 * If specified, [responseType] sets the desired response format for the |
| 149 * request. By default it is [String], but can also be 'arraybuffer', 'blob', |
| 150 * 'document', 'json', or 'text'. See also [HttpRequest.responseType] |
| 151 * for more information. |
| 152 * |
| 147 * The [withCredentials] parameter specified that credentials such as a cookie | 153 * The [withCredentials] parameter specified that credentials such as a cookie |
| 148 * (already) set in the header or | 154 * (already) set in the header or |
| 149 * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2) | 155 * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2) |
| 150 * should be specified for the request. Details to keep in mind when using | 156 * should be specified for the request. Details to keep in mind when using |
| 151 * credentials: | 157 * credentials: |
| 152 * | 158 * |
| 153 * * Using credentials is only useful for cross-origin requests. | 159 * * Using credentials is only useful for cross-origin requests. |
| 154 * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildca
rd (*). | 160 * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildca
rd (*). |
| 155 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru
e. | 161 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru
e. |
| 156 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse
t of all the response headers will be returned when calling [getAllRequestHeader
s]. | 162 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse
t of all the response headers will be returned when calling [getAllRequestHeader
s]. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 headers[key] = '${headers[key]}, $value'; | 371 headers[key] = '${headers[key]}, $value'; |
| 366 } else { | 372 } else { |
| 367 headers[key] = value; | 373 headers[key] = value; |
| 368 } | 374 } |
| 369 } | 375 } |
| 370 return headers; | 376 return headers; |
| 371 } | 377 } |
| 372 | 378 |
| 373 $!MEMBERS | 379 $!MEMBERS |
| 374 } | 380 } |
| OLD | NEW |