README
eye-http
A fast request library with XHR.
API Reference
Request
参数 | 描述 | 类型 | 值域 | 默认值 | 是否必须 |
---|---|---|---|---|---|
url | 请求地址 | String | 无 | 无 | 是 |
method | 请求类型 | String | get, post, jsonp | get | 否 |
timeout | 请求超时时间,默认不会超时 | Number | 无 | 0 | 否 |
credentials | 跨域请求是否可以发送凭据(例如:Cookie) | Boolean | 无 | false | 否 |
headers | 请求头部 | Object | 无 | {'Accept': '/', 'Content-Type': 'application/x-www-form-urlencoded'} | 否 |
params | get请求参数 | Object | 无 | {} | 否 |
body | post请求参数,支持FormData | Object | 无 | null | 否 |
progress | 请求实时进度 | Function | 无 | 无 | null |
Response
参数 | 描述 | 类型 |
---|---|---|
status | 状态码 | Number |
statusText | 状态描述 | String |
result | 返回数据 | Any |