popsicle-transport-xhr

Popsicle transport for sending requests over `XMLHttpRequest`

Usage no npm install needed!

<script type="module">
  import popsicleTransportXhr from 'https://cdn.skypack.dev/popsicle-transport-xhr';
</script>

README

Popsicle Transport XHR

NPM version NPM downloads Build status Test coverage

Popsicle transport for sending requests over XMLHttpRequest.

Installation

npm install popsicle-transport-xhr --save

Usage

import { transport } from "popsicle-transport-xhr";

const req = new Request("/");
const res = await transport()(req, done);

Transport Options

The transport function sends the Servie Request to a remote server.

  • type?: XMLHttpRequestResponseType Override response type
  • withCredentials?: boolean Enable withCredentials
  • overrideMimeType?: string Override MIME type

TypeScript

This project is written using TypeScript and publishes the definitions directly to NPM.

License

MIT