HttpUtils class

网络请求工具类 牛孝捡 20200508

Constructors

HttpUtils()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Properties

API_PREFIX String
default options
read / write
CONNECT_TIMEOUT int
read / write
dio Dio
global dio object
read / write
RECEIVE_TIMEOUT int
read / write

Static Methods

clear() → dynamic
清空 dio 对象
createInstance({dynamic api}) Dio
创建 dio 实例对象
request(BuildContext context, String url, {dynamic data, dynamic method, dynamic api, dynamic errorcallback}) Future<Map>
request method

Constants

DELETE → const String
'delete'
GET → const String
http request methods
'get'
PATCH → const String
'patch'
POST → const String
'post'
PUT → const String
'put'