Socket
Book a DemoInstallSign in
Socket

send-http-request

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

send-http-request

Function that sends a HTTP request, returning promise.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

send-http-request Build Status Dependency Status

Function that sends a HTTP request, returning a promise.

It uses XMLHTTPRequest, and will use the xmlhttprequest package in Node.js.

Usage

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:

  • getText()
  • getStatusCode()
  • getHeader(name)

Credits

The initial structure of this module was generated by Jumpstart, using the Jumpstart Black Coffee template.

License

send-http-request is released under the MIT License.
Copyright (c) 2013 Meryn Stol

FAQs

Package last updated on 31 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts