Closed gatecrasher777 closed 3 years ago
had a pr merged few days ago to allow for post requests
since neither the stream nor request is exposed?
guess you missed sth here 😉 check out my usage here https://github.com/TimeForANinja/node-ytsr/blob/wip-api-adjustments/lib/utils.js#L77
Aha! That's perfect, thanks.
Yes, it's called miniget but still... is there a designed way to make post requests with
let body = await miniget('http://mywebsite.com/submit/',options).text();
since neither the stream nor request is exposed? I made post requests work quite easily with just one extra line of code in the source:
if (options.method === "POST") activeRequest.write(options.postData);
just before the line that ends the request:
activeRequest.end();
Then the request options contain:
Is this useful, or is there an elegant way of achieving the same without altering the project source code?