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.2.2
  • Source
  • npm
  • Socket score

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

minixhr

super simple and small cross-browser XMLHttpRequest (XHR)

USAGE

var minixhr = require('minixhr')

// EXAMPLE 1
minixhr('https://jsonplaceholder.typicode.com/posts/1', response)

function response (data, response, xhr, header) {
  console.log(data)
}

// EXAMPLE 2
// make a temporary `http://requestb.in` to try the next example, e.g.
var data = { foo: 123, bar: "abc" }
var request  = { // can be 'url string' or object:
  /*required*/url     : 'http://requestb.in/18b4srl1', // replace with your example
  /*optional*/method  : 'POST',  // (defaults to 'GET')
  /*optional*/data    : JSON.stringify(data), // payload data could be <formdata> or {key:val}'s or any string
  /*optional*/headers : {} // (defaults to '{}' OR in case of 'POST' it defaults to:
              // {'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded' } )
}

minixhr(request) // [optional] callback - (e.g. leave out for POST Request where you don't care about a response
// check http://requestb.in/18b4srl1?inspect afterwards to inspect

if you need to support old browsers, use version 3.1.0 or below.
Those versions still include the xhr polyfill

Keywords

FAQs

Package last updated on 17 Jun 2017

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