Note: A progressive HTTP client for the browser and node.js
Package | Version | Docs | Description |
---|---|---|---|
tammy |
|||
tammy-adapter-xhr |
|||
tammy-adapter-request |
|||
tammy-plugin-xsrf |
|||
tammy-mock |
import { http } from 'tammy';
import xhr from 'tammy-adapter-xhr';
http.defaults.adapter = xhr;
http.get('/user?ID=12345')
.then(function (response) {
// 处理成功情况
})
.catch(function (error) {
// 处理异常情况
});
MIT