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.

61 lines
2.5 KiB

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