HTTPClient.prototype.request()
APINetwork
发起请求
调用方法
- (url, options) -> void
- (options) -> void
参数介绍
- options: {url, method, headers, encoding, data, timeout, dataType, onResponse, onSuccess, onError}请求选项
- method: String请求类型
- headers: Object<name, value>请求的头部信息
- encoding: String传输的字节编码
- data: BufferOrString需要提交的Payload内容
- timeout: Number请求超时时间
- dataType: String返回数据类型
- onResponse: (response) -> void当请求返回时的回调
- onSuccess: (result, response) -> void当请求返回成功时的回调
- onError: (error) -> void当请求失败时的回调
关联API
- HTTPClient()
- HTTPClient.prototype.download()
- HTTPClient.prototype.getCookies()
- HTTPClient.prototype.multipartRequest()
- HTTPClient.prototype.setCookie()