Skip to content

Instantly share code, notes, and snippets.

@PatrickJS
Last active May 21, 2024 06:04
Show Gist options
  • Save PatrickJS/6812a8412890adf14295de234f65eba7 to your computer and use it in GitHub Desktop.
Save PatrickJS/6812a8412890adf14295de234f65eba7 to your computer and use it in GitHub Desktop.
const { readable, writable } = new TransformStream();
fetch('/send?channel=123', method: 'POST',
headers: { 'Content-Type': 'text/plain' },
body: readable,
});
const response = await fetch('/receive?channel=123');
const response_readable = response.body;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment