xhr.responseText
为空时, 返回 ->{ httpStatus }
emptyStr
->allowEmptyString
- 移除 restful API ->
/{books_id}/{article_id}
emptyStr
->allowEmptyString
wya-fetch
->@wya/http
- ajaxFn -> createHTTPClient
- 所有的错误状态都会进入catch
- 除onProgress, 其他hook参数均接受对象, 参考文档
- ajaxFn 只接收
defaultOptions
- 增加API
emptyStr
- 增加API
restful
- 增加API
async
- 去除API
setCb
- 增加API
onBefore
, 类型func
, 返回值必须是Promise
;async/await
去兼容RN/AsyncStorage返回是Promise的情况;即(opts) => Promise
- 增加API
onAfter
, 类型func
, 返回值必须是Promise
;
- 给
requestType
添加选项'form-data:json',form-data
形式传递的数据再包装成data: JSON.stringify(data)
- 处理
Android Native
,''
->undefined
, 后者undefined
更加友好; - 添加主动取消
xhr.__ABORTED__ = true
- 使用
XMLHttpRequest
取代fetch
, 方便跨域
- 添加仓库