m-http-or-https

1.0.0 • Public • Published

m-http-or-https

A wrapper that choses http or https protocol according to the URL.

##Usage

To use this package, use the following:

var httpOrHttps = require('m-http-or-https');

var myUrl = 'https://www.mocky.io/v2/57d82dc00f00005002831406';
var myResponse = '';

httpOrHttps(myUrl, function(error, response) {
      response = JSON.parse(response);
      if (error) {
        console.log('[ERROR]', response);
      } else {
        console.log(response);
      }
    }
  );

Package Sidebar

Install

npm i m-http-or-https

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • russoedu