NetworkModule
小于 1 分钟
NetworkModule
HTTP请求模块
requestGet方法
发送HTTP GET请求
参数
参数 | 描述 | 类型 |
---|---|---|
url 必需 | 请求url | String |
param 必需 | 请求参数 | JSONObject |
responseCallback 必需 | 请求回调闭包 | NMResponse |
requestPost方法
发送HTTP POST请求
参数
参数 | 描述 | 类型 |
---|---|---|
url 必需 | 请求url | String |
param 必需 | 请求参数 | JSONObject |
responseCallback 必需 | 请求回调闭包 | NMResponse |
httpRequest方法
发送HTTP通用请求方法
参数
参数 | 描述 | 类型 |
---|---|---|
url 必需 | 请求url | String |
isPost 必需 | 是否为POST请求 | Boolean |
param 必需 | 请求参数 | JSONObject |
headers 非必需 | 请求头参数 | JSONObject |
cookie 非必需 | 请求cookie | String |
timeout 非必需 | 请求超时时间, 单位为秒 | Int |
responseCallback 必需 | 请求回调闭包 | NMResponse |