File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import {
1515} from './types' ;
1616import { Duplex } from 'stream' ;
1717import { request } from 'undici' ;
18+ import undici from 'undici' ;
19+ import stream from 'stream' ;
1820
1921const oldRequest = require ( 'request' ) ;
2022const format = require ( './utils/format' ) ;
@@ -300,10 +302,13 @@ export class Client {
300302 method : 'POST' ,
301303 headers : headers ,
302304 } ;
303- const jsonStreamStringify = JSONStream . stringify ( ) ;
304- const postRequest = oldRequest ( optionsRequest ) ;
305- jsonStreamStringify . pipe ( postRequest ) ;
306- return duplexer ( jsonStreamStringify , postRequest ) ;
305+ return stream . compose (
306+ JSONStream . stringify ( ) ,
307+ undici . pipeline ( optionsRequest , ( { statusCode, headers, body } ) => {
308+ // TODO:
309+ return body
310+ } )
311+ )
307312 }
308313
309314 /**
You can’t perform that action at this time.
0 commit comments