1.7.4 • Published 4 years ago

planck-http-fetch v1.7.4

Weekly downloads
38
License
MIT
Repository
github
Last release
4 years ago

planck-http-fetch

Simple promise-based HTTP/HTTPS fetch.

Install

npm install planck-http-fetch

Use

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.

1.7.4

4 years ago

1.7.3

4 years ago

1.7.2

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago