0.1.3 • Published 4 years ago
@aligov/mobile-request v0.1.3
@aligov/mobile-request
Install
$ npm install @aligov/mobile-request --save
Usage
import Button from '@aligov/mobile-request';
API
name | type | default | describe |
---|---|---|---|
url | String | 请求地址 | |
method | String | GET 可选值: GET/POST/PUT/DELETE/PATCH/HEAD | 请求地址 |
data | String | {} | 请求参数 |
headers | Bool | Content-Type': 'application/json' | 请求头 |
timeout | Number | 20000(ms) | 超时设置 |
dataType | String | json 可选值:json/text | 返回数据类型 |
Example
import request from '@aligov/mobile-request'
request({
url: '/xx/xx',
method: 'POST',
data: {}
})