https://github.com/mesosphere-backup/http-service
Wraps connections managed by the `@dcos/connection-manager` package into an Observable.
https://github.com/mesosphere-backup/http-service
http observable request rxjs stream
Last synced: 4 months ago
JSON representation
Wraps connections managed by the `@dcos/connection-manager` package into an Observable.
- Host: GitHub
- URL: https://github.com/mesosphere-backup/http-service
- Owner: mesosphere-backup
- License: apache-2.0
- Created: 2017-10-24T15:31:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T22:35:54.000Z (about 3 years ago)
- Last Synced: 2025-08-30T05:25:28.799Z (5 months ago)
- Topics: http, observable, request, rxjs, stream
- Language: JavaScript
- Size: 408 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP Service [](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")
});
```