# @mbamobi/http

> Requisição HTTP através de eventos com adição de plugins para interceptação

Latest version **4.1.1** (published 2018-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mbamobi/http
pnpm add @mbamobi/http
yarn add @mbamobi/http
bun add @mbamobi/http
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2018-01-25 |
| First published | 2017-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ramon Ornelas |
| Maintainers | cimbamobi, michael-xd, adminmba |
| Keywords | ionic, angular, url, http, headers, get, post |

## Links

- npm: https://www.npmjs.com/package/@mbamobi/http
- Repository: https://github.com/mbamobi/http
- Issues: https://github.com/mbamobi/http/issues
- npm.io page: https://npm.io/package/@mbamobi/http

## Dependencies (1)

- [@ramonornela/jsonpath](https://npm.io/package/@ramonornela/jsonpath.md) 0.2.10

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 4.1.1 (latest) — 2018-01-25
- 4.1.2-nightly.20180319T211829Z.d281c29-nightly.20180319T211829Z.d281c29 (nightly) — 2018-03-19
- 4.1.0 — 2018-01-25
- 4.0.0-nightly.20180120T141018Z.c50659a — 2018-01-20
- 4.0.0 — 2017-12-04
- 2.2.1-nightly.20171009T011022Z.5f0e096 — 2017-10-09
- 2.2.1-nightly.20170918T195608Z.b8d1a60 — 2017-09-28
- 2.2.1 — 2017-05-30
- 3.0.0 — 2017-04-07
- 2.2.0 — 2017-04-06
- 2.1.0 — 2017-04-06
- 2.0.0 — 2017-04-04
- 1.1.0 — 2017-04-04
- 1.0.1-nightly.20170317T193826Z.d0306c7 — 2017-03-17
- 1.0.1-nightly.20170309T181924Z.7938104 — 2017-03-09
- … 7 more at https://npm.io/package/@mbamobi/http/versions

## README

# HttpModule

This allow define urls Http using [url-resolver](https://github.com/mbamobi/url-resolver) to make request Http and intercept with plugins/events to analisy responses

## Using HttpModule in an Ionic 2 app

```typescript
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';

// import configuration module
import { ConfigurationModule } from '@mbamobi/configuration';

// import url-resolver module
import { UrlResolverModule } from '@mbamobi/url-resolver';

// Import http module
import { HttpModule, DefaultPlugins } from '@mbamobi/http';

export const APP_CONFIG = {
  'urlResolver': {
    'dev': {
      '_defaults': {
        'host': 'http://api.example.com/'
      },
      'user': {
        'url': 'user/{id}',
        'method': 'GET',
        'headers': {
          'content-type': 'application/json'
        },
        'params': {
          'id': {
            'type': 'number',
            'required': true
          }
        }
      }
    }
  }
};

@NgModule({
  declarations: [
    MyApp
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    ConfigurationModule.initialize(APP_CONFIG, 'dev')
    UrlResolverModule.initialize(),
    HttpModule.initialize(DefaultPlugins) // http module with plugin parseResponse
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp
  ]
})
export class AppModule {}
```

Contributing

See [CONTRIBUTING.md](https://github.com/mbamobi/http/blob/master/.github/CONTRIBUTING.md)

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