# gw-http

> gw-http

Latest version **0.0.4** (published 2021-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install gw-http
pnpm add gw-http
yarn add gw-http
bun add gw-http
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2021-03-29 |
| First published | 2021-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | gwb |
| Maintainers | lotosv2010 |
| Keywords | xhr, http, ajax, promise, node, axios |

## Links

- npm: https://www.npmjs.com/package/gw-http
- Repository: https://github.com/lotosv2010/g-http
- Homepage: https://github.com/lotosv2010/g-http#readme
- Issues: https://github.com/lotosv2010/g-http/issues
- npm.io page: https://npm.io/package/gw-http

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2021-03-29
- 0.0.4-2 (test) — 2021-03-29
- 0.0.4-1 — 2021-03-29
- 0.0.4-0 — 2021-03-29
- 0.0.3 — 2021-03-28
- 0.0.3-10 — 2021-03-28
- 0.0.3-9 — 2021-03-28
- 0.0.3-8 — 2021-03-28
- 0.0.3-7 — 2021-03-28
- 0.0.3-6 — 2021-03-28
- 0.0.3-5 — 2021-03-28
- 0.0.3-4 — 2021-03-28
- 0.0.3-3 — 2021-03-28
- 0.0.3-2 — 2021-03-28
- 0.0.3-1 — 2021-03-28
- … 3 more at https://npm.io/package/gw-http/versions

## README

# gw-http

## development

```bash
# 开发
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

```bash
npm i -S gw-http
```

### package

```js
import Http from "gw-http";

```

### Instance

```js
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

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

```

### get

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

```

---
_Source: https://npm.io/package/gw-http · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
