Skip to content

hangs when recording got.stream.post #2

@gr2m

Description

@gr2m

See example at https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md

import fs from "node:fs";
import fs from "node:fs";
import { promisify } from "node:util";

import HttpRecorder from "@gr2m/http-recorder";
import got from "got";

const pipeline = promisify(stream.pipeline);

HttpRecorder.enable()

// For POST, PUT, PATCH, and DELETE methods, `got.stream` returns a `stream.Writable`.
pipeline(
  fs.createReadStream("test.txt"),
  got.stream.post("http:/httpbin.org/post"),
  process.stdout
);

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions