Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

minixhr

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minixhr

super simpel and small cross-browser xhr

  • 3.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
increased by67.5%
Maintainers
1
Weekly downloads
 
Created
Source

minixhr

super simpel and small cross-browser xhr

USAGE

var minixhr = require('minixhr')

function responseHandler (error, data, response, xhr, header) {
  if (error) console.error('timeout: ', error)
  console.log(data)
}

var request  = { // can be 'url string' or object:
  url          : 'http://jsonplaceholder.typicode.com/posts/1',
  method       : 'POST',  // [optional] (defaults to 'GET')
  body         : 'payload', // [optional] payload data could be <formdata> or {key:val}'s or anything
  headers      : {} // [optional] (defaults to '{}' or in case of 'POST':
                   // {'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded' } )
}

// EXAMPLE 1
var callback = responseHandler
minixhr(request, callback) // [optional] callback - (e.g. leave out for POST Request where you don't care about a response

// EXAMPLE 2
minixhr('http://requestb.in/18b4srl1', function (data) { console.log(data) })
// check http://requestb.in/18b4srl1?inspect afterwards to inspect

// EXAMPLE 3 - github
minixhr()

Keywords

FAQs

Package last updated on 15 Feb 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc