GithubHelp home page GithubHelp logo

isabella232 / node-xmlhttprequest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lavamoat/node-xmlhttprequest

0.0 0.0 0.0 127 KB

XMLHttpRequest for node.js

Home Page: http://thedanexperiment.com/2009/10/04/emulating-xmlhttprequest-in-node-js/

License: MIT License

Ruby 0.63% JavaScript 99.37%

node-xmlhttprequest's Introduction

node-XMLHttpRequest

node-XMLHttpRequest is a wrapper for the built-in http client to emulate the browser XMLHttpRequest object.

This can be used with JS designed for browsers to improve reuse of code and allow the use of existing libraries.

Note: This library currently conforms to XMLHttpRequest 1. Version 2.0 will target XMLHttpRequest Level 2.

Usage

Here's how to include the module in your project and use as the browser-based XHR object.

var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhr = new XMLHttpRequest();

Note: use the lowercase string "xmlhttprequest" in your require(). On case-sensitive systems (eg Linux) using uppercase letters won't work.

Versions

Prior to 1.4.0 version numbers were arbitrary. From 1.4.0 on they conform to the standard major.minor.bugfix. 1.x shouldn't necessarily be considered stable just because it's above 0.x.

Since the XMLHttpRequest API is stable this library's API is stable as well. Major version numbers indicate significant core code changes. Minor versions indicate minor core code changes or better conformity to the W3C spec.

License

MIT license. See LICENSE for full details.

Supports

  • Async and synchronous requests
  • GET, POST, PUT, and DELETE requests
  • All spec methods (open, send, abort, getRequestHeader, getAllRequestHeaders, event methods)
  • Requests to all domains

Known Issues / Missing Features

For a list of open issues or to report your own visit the github issues page.

  • Local file access may have unexpected results for non-UTF8 files
  • Synchronous requests don't set headers properly
  • Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!).
  • Some events are missing, such as abort
  • Cookies aren't persisted between requests
  • Missing XML support

node-xmlhttprequest's People

Contributors

a2800276 avatar arthurblake avatar awinterman avatar brentlintner avatar bytespider avatar chawco avatar driverdan avatar fjakobs avatar gordonsmith avatar haykokoryun avatar jacwright avatar jbpros avatar josephg avatar keverw avatar krisnye avatar lfdoherty avatar maraujop avatar markandrus avatar matthewwithanm avatar max99x avatar mhansen avatar mixu avatar mrose17 avatar nishidayuya avatar ohar avatar pdehaan avatar pupeno avatar sebmaster avatar tomaash avatar tomhughes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.