0.0.4 • Published 3 years ago

gw-http v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

gw-http

development

# 开发
npm run compile
git add .
git cz

# 测试
npm version prerelease 
npm publish --tag test
npm i -S gw-http@test 

# 发布
npm version patch
npm publish

usage

download

npm i -S gw-http

package

import Http from "gw-http";

Instance

const http = new Http({
  url: "http://localhost:3000",
  headrs: {},
  errorControl: res => {
    console.error("error", res);
    return {
      error: true,
      errorMsg: 'error'
    }
  },
  dataControl: res => {
    return res;
  }
});

post

http.post("/login", {
  name: "test",
  age: 18
}).then(res => {
  console.log(res);
});

get

http.get("/getUser",{
    name: "test",
    age: 20
  },
  {
    cache: true
  }
).then(res => {
  console.log(res);
});
0.0.4-0

3 years ago

0.0.4-2

3 years ago

0.0.4-1

3 years ago

0.0.4

3 years ago

0.0.3-1

3 years ago

0.0.3-0

3 years ago

0.0.3-5

3 years ago

0.0.3-4

3 years ago

0.0.3-3

3 years ago

0.0.3-2

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.3-10

3 years ago

0.0.3-9

3 years ago

0.0.3-8

3 years ago

0.0.3-7

3 years ago

0.0.3-6

3 years ago

0.0.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago