eye-httpdeprecated

A fast request library with XHR.

Usage no npm install needed!

<script type="module">
  import eyeHttp from 'https://cdn.skypack.dev/eye-http';
</script>

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