Skip to content
main
Switch branches/tags
Code

Latest commit

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.3.3...v4.3.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
72beabb

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

w3c-xmlhttprequest Node.js CI

Server-side XMLHttpRequest like Living Standard for Node.

Install

$ npm install w3c-xmlhttprequest

or

$ yarn add w3c-xmlhttprequest

Example

Simple GET request

import { XMLHttpRequest } from 'w3c-xmlhttprequest';

const client = new XMLHttpRequest();
client.open('GET', 'https://example.com/');
client.addEventListener('load', () => {
  console.log('Received an HTTP response.');
}
client.send();

Parse JSON response

import { XMLHttpRequest } from 'w3c-xmlhttprequest';

const client = new XMLHttpRequest();
client.open('GET', 'https://exmaple.com/data.json');
client.responseType = 'json';
client.addEventListener('load', () => {
  const data = client.response;
  if (data.meta.status !== 200) return;
  console.log(data.response.blog.title);
});
client.send();

LICENSE

MIT License