https-request-promise

1.0.5 • Public • Published

https-request-promise

A simple way to make https requests in your JS projects.

Example:

const { request } = require('https-request-promise');

// Base HTTPS request options
const options = {
  method: 'POST',
  hostname: 'example.hostname.com',
  headers: {
    'Content-Type': 'application/json'
  },
};

// API Key
const api_key = 'ASDFGHJKL1234567890ASDFGHJKL1234567890ASDFGHJKL1234567890';

// A common API endpoint application...
const test = data => request({ ...options, path: '/api/test/it' }, { api_key, data });

(async () => test('Hello, API... I mean World!'))();

Readme

Keywords

none

Package Sidebar

Install

npm i https-request-promise

Weekly Downloads

5

Version

1.0.5

License

MIT

Unpacked Size

1.57 kB

Total Files

3

Last publish

Collaborators

  • ekschro