@rapper3/request
v0.1.1
Published
default fetch for rapper
Downloads
1
Readme
@rapper3/request
Based on axios
Connect with Rap, Pls see rap generate code firstly!
Install
yarn add @rapper3/request
Or
npm i @rapper3/request
Usage
import { useEffect } from 'react';
import { http, fetch } from 'src/rapper';
function App() {
async function fetchData() {
const data = await http('POST/user/info/header', {
token: 'token',
name: 'name222',
});
// or
// const data = await fetch['POST/user/info/header']({
// token: 'token',
// name: 'name222',
// });
}
return (
<>
<button onClick={() => fetchData()}>fetch</button>
</>
);
}
More details: Rapper http