You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0 KiB

  1. # node-XMLHttpRequest #
  2. node-XMLHttpRequest is a wrapper for the built-in http client to emulate the
  3. browser XMLHttpRequest object.
  4. This can be used with JS designed for browsers to improve reuse of code and
  5. allow the use of existing libraries.
  6. Note: This library currently conforms to [XMLHttpRequest 1](http://www.w3.org/TR/XMLHttpRequest/). Version 2.0 will target [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/).
  7. ## Usage ##
  8. Here's how to include the module in your project and use as the browser-based
  9. XHR object.
  10. var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
  11. var xhr = new XMLHttpRequest();
  12. Note: use the lowercase string "xmlhttprequest" in your require(). On
  13. case-sensitive systems (eg Linux) using uppercase letters won't work.
  14. ## Versions ##
  15. Prior to 1.4.0 version numbers were arbitrary. From 1.4.0 on they conform to
  16. the standard major.minor.bugfix. 1.x shouldn't necessarily be considered
  17. stable just because it's above 0.x.
  18. Since the XMLHttpRequest API is stable this library's API is stable as
  19. well. Major version numbers indicate significant core code changes.
  20. Minor versions indicate minor core code changes or better conformity to
  21. the W3C spec.
  22. ## License ##
  23. MIT license. See LICENSE for full details.
  24. ## Supports ##
  25. * Async and synchronous requests
  26. * GET, POST, PUT, and DELETE requests
  27. * All spec methods (open, send, abort, getRequestHeader,
  28. getAllRequestHeaders, event methods)
  29. * Requests to all domains
  30. ## Known Issues / Missing Features ##
  31. For a list of open issues or to report your own visit the [github issues
  32. page](https://github.com/driverdan/node-XMLHttpRequest/issues).
  33. * Local file access may have unexpected results for non-UTF8 files
  34. * Synchronous requests don't set headers properly
  35. * Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!).
  36. * Some events are missing, such as abort
  37. * getRequestHeader is case-sensitive
  38. * Cookies aren't persisted between requests
  39. * Missing XML support
  40. * Missing basic auth