1.0.1 • Published 4 years ago
@tongh/easy-request v1.0.1
Request
A small and simply HTTP package for browser
Install
npm:
npm install @tongh/requestyarn:
yarn add @tongh/requestusage
import { request } from "@tongh/request"
request.post("http://localhost:9090/api/user/create", { name: "my name", sex: "gril" })
.then((result) => {
// todo...
})
.catch((error) => {
// todo...
})this package exported two methods request and Request. the fomer is a Request instance
the fomer is a class. used to custom your own request with new keyvalue. for example
1.0.1
4 years ago