@@ -408,36 +408,39 @@ class Http {
408
408
return (parsed.scheme == originUrl.scheme && parsed.host == originUrl.host);
409
409
}
410
410
411
- /**
412
- * Returns a [Future<HttpResponse>] when the request is fulfilled.
413
- *
414
- * Named Parameters:
415
- * - method: HTTP method (e.g. 'GET', 'POST', etc)
416
- * - url: Absolute or relative URL of the resource being requested.
417
- * - data: Data to be sent as the request message data.
418
- * - params: Map of strings or objects which will be turned to
419
- * `?key1=value1&key2=value2` after the url. If the values are
420
- * not strings, they will be JSONified.
421
- * - headers: Map of strings or functions which return strings representing
422
- * HTTP headers to send to the server. If the return value of a function
423
- * is null, the header will not be sent.
424
- * - withCredentials: True if cross-site requests should use credentials such as cookies or
425
- * authorization headers; false otherwise. If not specified, defaults to false.
426
- * - xsrfHeaderName: TBI
427
- * - xsrfCookieName: TBI
428
- * - interceptors: Either a [HttpInterceptor] or a [HttpInterceptors]
429
- * - cache: Boolean or [Cache] . If true, the default cache will be used.
430
- * - timeout: deprecated
431
- */
411
+ /**
412
+ * Returns a [Future<HttpResponse>] when the request is fulfilled.
413
+ *
414
+ * Named Parameters:
415
+ * - method: HTTP method (e.g. 'GET', 'POST', etc)
416
+ * - url: Absolute or relative URL of the resource being requested.
417
+ * - data: Data to be sent as the request message data.
418
+ * - params: Map of strings or objects which will be turned to
419
+ * `?key1=value1&key2=value2` after the url. If the values are
420
+ * not strings, they will be JSONified.
421
+ * - headers: Map of strings or functions which return strings representing
422
+ * HTTP headers to send to the server. If the return value of a function
423
+ * is null, the header will not be sent.
424
+ * - withCredentials: True if cross-site requests should use credentials such as cookies or
425
+ * authorization headers; false otherwise. If not specified, defaults to false.
426
+ * - xsrfHeaderName: XSRF header name sent with the request. If not specified
427
+ * [defaults.xsrfHeaderName] is used.
428
+ * - xsrfCookieName: XSRF cookie name. If not specified [defaults.xsrfCookieName] is used.
429
+ * - interceptors: Either a [HttpInterceptor] or a [HttpInterceptors]
430
+ * - cache: Boolean or [Cache] . If true, null or not specified at all, the default cache will be
431
+ * used. If false, no cache will be used. If object of type [Cache] is provided, that object
432
+ * will be used as cache.
433
+ * - timeout: deprecated
434
+ */
432
435
async .Future <HttpResponse > call ({
433
436
String url,
434
437
String method,
435
438
data,
436
439
Map <String , dynamic > params,
437
440
Map <String , dynamic > headers,
438
441
bool withCredentials: false ,
439
- xsrfHeaderName,
440
- xsrfCookieName,
442
+ String xsrfHeaderName,
443
+ String xsrfCookieName,
441
444
interceptors,
442
445
cache,
443
446
timeout
@@ -479,7 +482,7 @@ class Http {
479
482
480
483
if (cache == false ) {
481
484
cache = null ;
482
- } else if (cache == null ) {
485
+ } else if (cache == true || cache == null ) {
483
486
cache = defaults.cache;
484
487
}
485
488
0 commit comments