Http Method
地址/链接
Optional
options: { 请求配置
Optional
callback?: anyOptional
data?: anyOptional
headers?: anyOptional
isOptional
params?: anyOptional
raw?: booleanxFetch('get', 'https://api.uomg.com/api/rand.qinghua?x=1', { params: { format: 'json', hello: 456 } }).then(data => console.log(data)); /// fetchXPromise
xFetch('POST', 'https://test.cn', { headers: { contentType: 'application/json' }, data: { test: 123 } }).catch(error => console.log(error)); /// fetchXPromise
fetch 简单封装