# http-client-decorator

> http client with decorator

Latest version **1.0.1** (published 2018-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-client-decorator
pnpm add http-client-decorator
yarn add http-client-decorator
bun add http-client-decorator
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-12-26 |
| First published | 2018-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zzy |
| Maintainers | skunight |
| Keywords | http-client, http, client, decorator |

## Links

- npm: https://www.npmjs.com/package/http-client-decorator
- Repository: https://github.com/skunight/http-client-decorator
- npm.io page: https://npm.io/package/http-client-decorator

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [@types/node](https://npm.io/package/@types/node.md) ^10.12.18
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.12

## 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

- 1.0.1 (latest) — 2018-12-26
- 1.0.0 — 2018-12-26

## README

# Http Client Decorator

web http client decorator

### Installation

**Yarn**
```bash
yarn add http-client-decorator
```

**NPM**
```bash
npm install http-client-decorator --save
```

### Getting Started
Http client is use [Axios](https://github.com/axios/axios)

```typescript
@Http(options)  //options is Axios.create options
class Test {
  @Get('url',{data},{config})     //config is instance.request config
  method1(@Res res?) {
  }
  @Post('url',{data},{config})
  method2(@Res res?) {
  }
  @Fetch(RequestMethod.PUT,'url',{data},{config})
  method3(@Res res?) {
  }
}
```
RequestMethod is a enum
```typescript
enum  RequestMethod {
  GET = 'GET',
  POST = 'POST',
  HEAD = 'HEAD',
  PUT = 'PUT',
  DELETE = 'DELETE',
  OPTIONS = 'OPTIONS',
  PATCH = 'PATCH',
}
```

That's it!

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