package
Function that sends a HTTP request, returning promise.
npm install send-http-requestGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 4 packages.
617.6 kB
Includes dependencies.

Function that sends a HTTP request, returning a promise.
It uses XMLHTTPRequest, and will use the xmlhttprequest package in Node.js.
sendRequest = require("send-http-request")
sendRequest("GET","http://localhost/").then(
function(response) { console.log(response) },
function(error) { console.error(error) }
)You may pass optional headers and data arguments. If only one extra parameter is given, it's assumed to be the headers object.
The response object has the following methods:
The initial structure of this module was generated by Jumpstart, using the Jumpstart Black Coffee template.
send-http-request is released under the MIT License.
Copyright (c) 2013 Meryn Stol