agent/agent/http/fetch library




defaultTimeout → const Duration


defaultFetch({required String endpoint, String? host, String? defaultHost, FetchMethod method =, Map<String, String>? baseHeaders, Map<String, String>? headers, Duration? timeout = defaultTimeout, bool cbor = true, dynamic body}) Future<Map<String, dynamic>>
defaultFetch is a wrapper of http.get, which can be replaced by any other http packages (e.g. dio). http has embedded by default, so the library use it directly. Users can set host should be full path of http/https. Usually the usage could be defaultHost+endpoint and set the defaultHost to somewhere final, then change the endpoint programatically. Duration(second: 30) is the default timeout limit, and throw error directly to end the request section.