# @vendasta/vhttp

> vHttp is a Angular2 component for making HTTP calls.

Latest version **0.0.0** (published 2016-06-09) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @vendasta/vhttp
pnpm add @vendasta/vhttp
yarn add @vendasta/vhttp
bun add @vendasta/vhttp
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2016-06-09 |
| First published | 2016-06-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | vendasta r&d |
| Maintainers | vendasta |

## Links

- npm: https://www.npmjs.com/package/@vendasta/vhttp
- npm.io page: https://npm.io/package/@vendasta/vhttp

## Recent versions

- 0.0.0 (latest) — 2016-06-09

## README

# vHttp

vHttp is a Angular2 component for making HTTP calls.

## Requirements

First, you will need to include the component into your application.

```
npm install @vendasta/fec-icon [--save-dev]
```

Using vHttp requires having HTTP providers in your application (app.ts) as such:

```
@Component({
    ...
    directives: [
        HTTP_PROVIDERS
    ]
})

bootstrap(AppComponent, [
    HTTP_PROVIDERS
]);
```

## Usage

The 'vHttp' service is injected into other components to allow the other components to make HTTP calls. To use it: import it, include it within your providers, and instantiate it in your constructor.

```
import {VHttpService} from "@vendasta/fec/vhttp/vhttp.service";

@Component({
    ...
    providers: [VHttpService],
    ...
})

export class TestComponent {
    ...
    constructor(private vHttpService: VHttpService){}
    ...
}
```

You can then use the vHttp service to make API calls that returns the **data field** of a JSON object returned by the API.

```
export class TestComponent {
    ...
    useVHttpService(url) {
        this.vHttpService.get(url).subscribe(
            result => this.testItems = result,
            error => this.errorMessage = <any>error;
        )
    }
}
```

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