# simple-api-request

> The module to work with API

Latest version **1.0.2** (published 2019-07-31) · 0 weekly downloads

## Install

```sh
npm install simple-api-request
pnpm add simple-api-request
yarn add simple-api-request
bun add simple-api-request
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-07-31 |
| First published | 2019-07-17 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 111.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mahdi Ridho |
| Maintainers | mahdiiridho |
| Keywords | api request, http request, http client service, angular, ionic |

## Links

- npm: https://www.npmjs.com/package/simple-api-request
- Repository: https://github.com/mahdiridho/funlibraries
- Homepage: https://github.com/mahdiridho/funlibraries#readme
- Issues: https://github.com/mahdiridho/funlibraries/issues
- npm.io page: https://npm.io/package/simple-api-request

## 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.2 (latest) — 2019-07-31
- 1.0.1 — 2019-07-26
- 1.0.0 — 2019-07-26
- 0.0.3 — 2019-07-19
- 0.0.2 — 2019-07-17
- 0.0.1 — 2019-07-17

## README

# ApiRequest
The module to work with API

## Quick installation
From your project app run below :

```
npm i --save api-request/dist/api-request-<version>.tgz
```

Add the module to the project app module e.g app.module.ts :

```
import { ApiRequestModule } from 'api-request';
...

imports: [
    ...
    ApiRequestModule
]
```

Finally, insert the element to the component template e.g :

```
<api-request #api (apiEvent)="listener($event)" [baseUrl]="baseUrl"></api-request>
```

To make a request :

```
Format:
this.api.service.call("post" || "get", endpoint<string>, body<any>, header<any>)

e.g
this.api.service.call("post", "/api/auth/", 
    {
        username: "user1", 
        password: "123456"
    },
    {
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    }).subscribe(
        result => console.log(result),
        error => console.log(error)
    )
```

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