1.0.10 • Published 5 years ago

@cloudseat/http-client v1.0.10

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

A super lightweight HTTP / HTTPS client can be used in any Node.js project. Although it's not as powerful as request / axios / superagent, it is sufficient for common development scenarios, such as calling third-party APIs and obtaining remote pictures.

Installation

npm install @cloudseat/http-client

Usage

const http = require('@cloudseat/http-client')

const result = await http.get(url[, options])
const result = await http.post(url[, data][, options])
const result = await http.put(url[, data][, options])
const result = await http.del(url[, options])
const result = await http.request(options)

Parameters

  • url - Request url. Supports http/https protocol.
  • data - Send data. Supports string, json object, buffer, arraybufferand stream.
  • options
    • method - GET(default), POST, PUT, DELETE.
    • headers - The Content-Type defaults to application/json.
    • responseType - Supports arraybuffer, stream or null.
1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago