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