Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fengxinming/tammy
:zap: Promise based HTTP client for the browser and node.js
https://github.com/fengxinming/tammy
ajax axios http promise tammy
Last synced: 6 days ago
JSON representation
:zap: Promise based HTTP client for the browser and node.js
- Host: GitHub
- URL: https://github.com/fengxinming/tammy
- Owner: fengxinming
- License: mit
- Created: 2019-03-17T08:51:59.000Z (over 5 years ago)
- Default Branch: dev
- Last Pushed: 2020-01-01T09:37:29.000Z (almost 5 years ago)
- Last Synced: 2024-10-29T21:04:52.653Z (17 days ago)
- Topics: ajax, axios, http, promise, tammy
- Language: JavaScript
- Homepage:
- Size: 232 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tammy
> Note: A progressive HTTP client for the browser and node.js[![npm package](https://nodei.co/npm/tammy.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/tammy)
---
| Package | Version | Docs | Description |
| ------- | ------- | ---- | ----------- |
| [`tammy`](/packages/tammy) | [![npm](https://img.shields.io/npm/v/tammy.svg?style=flat-square)](https://www.npmjs.com/package/tammy) | [![](https://img.shields.io/badge/API%20Docs-markdown-lightgrey.svg?style=flat-square)](/packages/tammy#readme) | |
| [`tammy-adapter-xhr`](/packages/tammy-adapter-xhr) | [![npm](https://img.shields.io/npm/v/tammy-adapter-xhr.svg?style=flat-square)](https://www.npmjs.com/package/tammy-adapter-xhr) | [![](https://img.shields.io/badge/API%20Docs-markdown-lightgrey.svg?style=flat-square)](/packages/tammy-adapter-xhr#readme) | |
| [`tammy-adapter-request`](/packages/tammy-adapter-request) | [![npm](https://img.shields.io/npm/v/tammy-adapter-request.svg?style=flat-square)](https://www.npmjs.com/package/tammy-adapter-request) | [![](https://img.shields.io/badge/API%20Docs-markdown-lightgrey.svg?style=flat-square)](/packages/tammy-adapter-request#readme) | |
| [`tammy-plugin-xsrf`](/packages/tammy-plugin-xsrf) | [![npm](https://img.shields.io/npm/v/tammy-plugin-xsrf.svg?style=flat-square)](https://www.npmjs.com/package/tammy-plugin-xsrf) | [![](https://img.shields.io/badge/API%20Docs-markdown-lightgrey.svg?style=flat-square)](/packages/tammy-plugin-xsrf#readme) | |
| [`tammy-mock`](/packages/tammy-mock) | [![npm](https://img.shields.io/npm/v/tammy-mock.svg?style=flat-square)](https://www.npmjs.com/package/tammy-mock) | [![](https://img.shields.io/badge/API%20Docs-markdown-lightgrey.svg?style=flat-square)](/packages/tammy-mock#readme) | |---
## Usage
```js
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) {
// 处理异常情况
});
```## License
MIT