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 - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

6

minixhr.js
var XMLHttpRequest = require('xhrpolyfill')
module.exports = function xhr2 (params, callback) {
// returns/calls: callback(data, response, xhr)
var url = typeof params === 'string' ? params : params.url
// e.g. url = "http://jsonplaceholder.typicode.com/posts/1"
var method = params.method || (params.data ? 'POST': 'GET')
var body = params.data // data: formdata or {key:val}
var body = params.data
var H = params.headers ? params.headers : params.body ? {

@@ -15,3 +13,3 @@ 'X-Requested-With' :'XMLHttpRequest',

xhr.open(method, url)
for (var field in H) xhr.setRequestHeader(field, H[field])
for (var key in H) xhr.setRequestHeader(key, H[key])
xhr.onload = xhr.onerror = function (response) {

@@ -18,0 +16,0 @@ var Hjson = {}, h = xhr.getAllResponseHeaders()

{
"name": "minixhr",
"version": "3.0.1",
"version": "3.0.2",
"description": "super simpel and small cross-browser xhr",

@@ -5,0 +5,0 @@ "main": "minixhr.js",

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