# planck-http-fetch

> Simple http/https fetch

Latest version **1.7.4** (published 2020-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install planck-http-fetch
pnpm add planck-http-fetch
yarn add planck-http-fetch
bun add planck-http-fetch
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.4 |
| Published | 2020-06-25 |
| First published | 2018-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Krzysztof Heim |
| Maintainers | pankleks |
| Keywords | http, https, fetch |

## Links

- npm: https://www.npmjs.com/package/planck-http-fetch
- Repository: https://github.com/pankleks/planck-http-fetch
- Homepage: https://github.com/pankleks/planck-http-fetch#readme
- Issues: https://github.com/pankleks/planck-http-fetch/issues
- npm.io page: https://npm.io/package/planck-http-fetch

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.7.4 (latest) — 2020-06-25
- 1.7.3 — 2020-06-19
- 1.7.2 — 2020-06-19
- 1.7.1 — 2020-04-10
- 1.7.0 — 2020-04-10
- 1.6.3 — 2019-09-18
- 1.6.2 — 2019-09-18
- 1.6.1 — 2019-05-01
- 1.6.0 — 2019-05-01
- 1.5.0 — 2019-04-18
- 1.4.0 — 2019-03-05
- 1.3.0 — 2018-03-13
- 1.2.0 — 2018-02-01
- 1.1.0 — 2018-02-01
- 1.0.6 — 2018-02-01
- … 6 more at https://npm.io/package/planck-http-fetch/versions

## README

# planck-http-fetch

Simple promise-based HTTP/HTTPS fetch.

## Install

`npm install planck-http-fetch`

## Use

```typescript
import { Fetch } from "planck-http-fetch";

const data = await new Fetch("https://...") // url
    .timeout(5000)  // timeout 5s
    .head("Api-Key", "123") // sets header
    .head("Host", "my.host.com")    // sets another header
    .basicAuth("user", "password")  // enables basic auth in HTTP header
    .unauthorized() // skips certificate check if https
    .fetch("data to send", "text/plain");   // do request with data and content type
```

For `fetch` method:

> If `data` is set `POST` is used, else `GET`

> If `contentType` is not set, `application/json;charset=utf-8` is used

### 307 temp. redirect

From version 1.7.2, temp. redirections (307) are handled automatically

## More info?

All methods have `JSDoc` comments, they provides more info on usage.

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