# @ciscospark/http-core

> Core HTTP library for the Cisco Webex

Latest version **1.52.2** (published 2019-05-01) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install @ciscospark/http-core
pnpm add @ciscospark/http-core
yarn add @ciscospark/http-core
bun add @ciscospark/http-core
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.52.2 |
| Published | 2019-05-01 |
| First published | 2015-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 11 |
| Unpacked size | 168 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 205 |
| Author | Ian W. Remmel |
| Maintainers | adamweeks, mattnorris, webex-jenkins |

## Links

- npm: https://www.npmjs.com/package/@ciscospark/http-core
- Repository: https://github.com/webex/spark-js-sdk/tree/master/packages/node_modules/@ciscospark/http-core
- npm.io page: https://npm.io/package/@ciscospark/http-core

## Dependencies (11)

- [qs](https://npm.io/package/qs.md) ^6.5.1
- [xtend](https://npm.io/package/xtend.md) ^4.0.1
- [envify](https://npm.io/package/envify.md) ^4.1.0
- [global](https://npm.io/package/global.md) ^4.3.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [request](https://npm.io/package/request.md) ^2.81.0
- [file-type](https://npm.io/package/file-type.md) ^3.9.0
- [is-function](https://npm.io/package/is-function.md) ^1.0.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.23.0
- [parse-headers](https://npm.io/package/parse-headers.md) ^2.0.1
- [@ciscospark/common](https://npm.io/package/@ciscospark/common.md) 1.52.2

## Recent versions

- 1.52.2 (latest) — 2019-05-01
- 0.7.0-alpha.10dc6ffb (lerna-temp) — 2016-08-09
- 0.7.0-alpha.a5bc0482 (canary) — 2016-07-29
- 0.6.4 (stable) — 2016-06-27
- 1.52.1 — 2019-04-30
- 1.52.0 — 2019-04-26
- 1.50.19 — 2019-04-09
- 1.50.18 — 2019-04-04
- 1.50.17 — 2019-04-03
- 1.50.16 — 2019-04-02
- 1.50.15 — 2019-04-01
- 1.50.13 — 2019-03-28
- 1.50.12 — 2019-03-27
- 1.50.11 — 2019-03-27
- 1.50.6 — 2019-03-15
- … 162 more at https://npm.io/package/@ciscospark/http-core/versions

## README

# @ciscospark/http-core

[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

> Core HTTP library for the Cisco Webex JS SDK.

- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [Maintainers](#maintainers)
- [License](#license)

## Install

```bash
npm install --save @ciscospark/http-core
```

## Usage

### `detect()`, `detectSync()`

Detects the filetype of the specified file.

### request()

Same api as [request](https://github.com/request/request) with the following changes:

- Promise-based instead of nodeback based
- Adds an interceptors property to the options object for adding classes that intercept and modify each request
- 4XX and 5XX responses get rejected with the appropriate subclassed Error type
- Sensible defaults for our API (`{json:true}`, etc)

### `defaults()`

Curried version of `request()` that produces an http client with overridden defaults.

### `HttpError`

Child of `Error` (by way of `Exception` from `@ciscospark/common`). Has subclassed errors for each [official HTTP status code](https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) (and 429 Too Man Requests).


## Maintainers

This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).

## Contribute

Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/spark-js-sdk/blob/master/CONTRIBUTING.md) for more details.

## License

© 2016-2018 Cisco and/or its affiliates. All Rights Reserved.

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