use-http-vue

0.0.1 • Public • Published

use-http-vue

A Vue 3 composition API for making HTTP requests.

It is just a design idea, no implement. Don't use it now.

Note: This is a work in progress and is not yet ready for use. Pull requests are welcome.

Install

npm install use-http-vue

Usage

Basic Usage

import { useHttp } from 'use-http-vue';
// make a get request
const [data, loading, sendHttp, error] = useHttp('https://jsonplaceholder.typicode.com/posts');
// make a post request
const [data, loading, sendHttp, error] = useHttp.post('https://jsonplaceholder.typicode.com/posts',{title:'foo',body:'bar',userId:1});
// other methods
// useHttp.put,useHttp.delete,useHttp.head etc

Readme

Keywords

none

Package Sidebar

Install

npm i use-http-vue

Weekly Downloads

3

Version

0.0.1

License

ISC

Unpacked Size

1.11 kB

Total Files

3

Last publish

Collaborators

  • zhou-qi-jun