# @dcos/http-service

> --- 👩‍🔬 Please be aware that this package is still experimental — changes to the interface and underlying implementation are likely, and future development or maintenance is not guaranteed.

Latest version **2.3.2** (published 2019-06-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @dcos/http-service
pnpm add @dcos/http-service
yarn add @dcos/http-service
bun add @dcos/http-service
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.2 |
| Published | 2019-06-13 |
| First published | 2017-10-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 210.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | brandonc, dschmidt, fabsn, juliangieseke, mesosphere-frontend-ci, mesosphere-it, mperrotti, natmegs, nlight, orlandohohmeier, specone, tattdcodemonkey, tnguyen0 |

## Links

- npm: https://www.npmjs.com/package/@dcos/http-service
- Repository: https://github.com/dcos-labs/http-service
- Homepage: https://github.com/dcos-labs/http-service#readme
- Issues: https://github.com/dcos-labs/http-service/issues
- npm.io page: https://npm.io/package/@dcos/http-service

## Dependencies (3)

- [rxjs](https://npm.io/package/rxjs.md) 6.3.3
- [@dcos/connections](https://npm.io/package/@dcos/connections.md) 0.4.0
- [@dcos/connection-manager](https://npm.io/package/@dcos/connection-manager.md) 0.3.1

## Recent versions

- 2.3.2 (latest) — 2019-06-13
- 2.3.1 — 2019-05-29
- 2.3.0 — 2019-05-29
- 2.2.0 — 2019-05-28
- 2.1.0 — 2019-04-17
- 2.0.2 — 2019-02-19
- 2.0.1 — 2019-02-15
- 2.0.0 — 2018-12-19
- 1.1.0 — 2018-12-18
- 1.0.0 — 2018-08-27
- 0.3.0 — 2018-03-27
- 0.2.1 — 2017-12-14
- 0.2.0 — 2017-11-24
- 0.1.0 — 2017-10-24

## README

# HTTP Service [![Build Status](https://travis-ci.org/dcos-labs/http-service.svg?branch=master)](https://travis-ci.org/dcos-labs/http-service)

---
👩‍🔬  Please be aware that this package is still experimental —
changes to the interface  and underlying implementation are likely,
and future development or maintenance is not guaranteed.

---

This package wraps connections managed by the `@dcos/connection-manager` package into an Observable.

## Usage
```javascript
import { request, stream } from "@dcos/http-service";

request("http://localhost:4200/payload.json")
  .retry(3)
  .subscribe({
    next: ({ code, message, response }) => console.log(code, message, response),
    error: ({ code, message, response }) => console.error(code, message, response),
    complete: () => console.log("complete")
  });

stream("http://localhost:4200/mesos/api/v1", {
  method: "POST",
  responseType: "text",
  body: JSON.stringify({ type: "SUBSCRIBE" }),
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  }
})
  .subscribe({
    next: data => console.log(data),
    error: event => console.log(event),
    complete: () => console.log("complete")
  });
```

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