http2-client icon indicating copy to clipboard operation
http2-client copied to clipboard

Cannot create custom HttpRequestManager

Open jellelute opened this issue 6 years ago • 2 comments

Hi,

Thanks for the library. I would like to make use of the HttpRequestManager to be able to reuse the connection. I'm following the exact code example:

const {HttpRequestManager} = require('http2-client'); const httpRequestManager = new HttpRequestManager();

and i'm getting this error: TypeError: HttpRequestManager is not a constructor I'm tried using nodejs12 and nodejs10. I use typescript and i'm compiling to ES6, but also tried ES2018. Did you export this class?

jellelute avatar Jul 29 '19 08:07 jellelute

Hey,

It's not exported by "main" this is why you cannot require it. You could be using:

const {HttpRequestManager} = require('http2-client/lib/request');

Although it's not recommended using something that is not exported... Please let me know if it works for you and why you need it.. and I may export it in next version..

hisco avatar Jul 30 '19 06:07 hisco

Hey hisco,

Thanks, this will work for me!

jellelute avatar Aug 02 '19 08:08 jellelute