APIConfig class
默认配置, 在调用 APISession 之前, 必须先调用 APICore.initialize 才会生效
Constructors
- APIConfig({String? baseUrl, Duration? connectTimeout = const Duration(seconds: 60), String? contentType, bool ensureNonNullHeadersFields = false, bool ensureNonNullParametersFields = false, Parameters? extra, bool? followRedirects, HTTPHeader? headers, bool isHandleErrors = false, bool isToastErrors = false, ListFormat? listFormat, int? maxRedirects, HTTPMethod? method = HTTPMethod.GET, bool? persistentConnection, bool postUseFormData = false, String prefixPath = '', bool preserveHeaderCase = false, Parameters? queryParameters, bool? receiveDataWhenStatusError, Duration? receiveTimeout = const Duration(seconds: 60), RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ResponseType? responseType = ResponseType.json, Duration? sendTimeout, String suffixPath = '', ValidateStatus? validateStatus})
Properties
- baseUrl → String?
-
默认 URL
final
- connectTimeout → Duration?
-
连接超时时间
final
- contentType → String?
-
final
- ensureNonNullHeadersFields → bool
-
确保 Headers 字段不为空
final
- ensureNonNullParametersFields → bool
-
确保 Parameters 字段不为空
final
- extra → Parameters?
-
final
- followRedirects → bool?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headers → HTTPHeader?
-
默认请求头
final
- isHandleErrors → bool
-
是否处理错误
final
- isToastErrors → bool
-
final
- listFormat → ListFormat?
-
final
- maxRedirects → int?
-
final
- method → HTTPMethod?
-
请求方式
final
- persistentConnection → bool?
-
final
- postUseFormData → bool
-
Post 方式默认使用 FormData
final
- prefixPath → String
-
跟随主域名后面的前缀
final
- preserveHeaderCase → bool
-
final
- queryParameters → Parameters?
-
final
- receiveDataWhenStatusError → bool?
-
final
- receiveTimeout → Duration?
-
接收超时时间
final
- requestEncoder → RequestEncoder?
-
final
- responseDecoder → ResponseDecoder?
-
final
- responseType → ResponseType?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendTimeout → Duration?
-
发送超时时间
final
- suffixPath → String
-
跟随主域名后面的后缀
final
- validateStatus → ValidateStatus?
-
final
Methods
-
copyWith(
{String? baseUrl, Duration? connectTimeout, String? contentType, bool? ensureNonNullHeadersFields, bool? ensureNonNullParametersFields, Parameters? extra, bool? followRedirects, HTTPHeader? headers, bool? isHandleErrors, bool? isToastErrors, ListFormat? listFormat, int? maxRedirects, HTTPMethod? method, bool? persistentConnection, bool? postUseFormData, String? prefixPath, bool? preserveHeaderCase, Parameters? queryParameters, bool? receiveDataWhenStatusError, Duration? receiveTimeout, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ResponseType? responseType, Duration? sendTimeout, String? suffixPath, ValidateStatus? validateStatus}) → APIConfig -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited