BaseHttpConstant class
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Constants
- APP_BIND_SERVER_KEY → const String
- APP_BIND_SERVER_SECRET → const String
- APP_BUSINESS_KEY → const String
- APP_BUSINESS_SECRET → const String
- APP_DEVICE_STATE_KEY → const String
- APP_DEVICE_STATE_SECRET → const String
- CACHE_ENABLE → const bool
- 是否开启缓存
- CONNECT_TIMEOUT → const Duration
- 连接超时时间 ms
- CONTENT_TYPE → const String
-
请求的Content-Type,默认值是"application/json; charset=utf-8"
如果您想以"application/x-www-form-urlencoded"格式编码请求数据,
可以设置此选项为
Headers.formUrlEncodedContentType
, 这样Dio
就会自动编码请求体. -
HEADERS
→ const Map<
String, String> - 请求头{'tenantId': '1000'}
- HEADERS_NETWORK_DEBOUNCE_KEY → const String
- 网络请求防抖key(headers中)
- RECEVICE_TIMEOUT → const Duration
- 接收超时时间 ms
- RESPONSE_TYPE → const ResponseType
-
responseType
表示期望以那种格式(方式)接受响应数据。 目前ResponseType
接受三种类型JSON
,STREAM
,PLAIN
. 默认值是JSON
, 当响应头中content-type为"application/json"时,dio 会自动将响应内容转化为json对象。 如果想以二进制方式接受响应数据,如下载一个二进制文件,那么可以使用STREAM
. 如果想以文本(字符串)格式接收响应数据,请使用PLAIN
. - TAG → const String