junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 23 forks source link

Getting images using new Http1 or Http2 methods #96

Closed RenzoBeux closed 1 year ago

RenzoBeux commented 1 year ago

Hi, On version 5 i was using the request method to get champion images by using the .body() method in the response which was ReadableStream which also was the input of a streamPipeline.

image image

Right now with this new methods I can only access to string or object (text() and json() methods) responses but cant access directly to the stream. I am missing something or this cannot be done with this new version methods?

PD: I'm using DEPRECATED_request as a temporary solution but I would like to fully migrate to new API.

junlarsen commented 1 year ago

Ah yeah, the new http1/http2 support does currently not support streaming the response yet. It shouldn't be too difficult to change, you could just add an option to pipe the response data in the createHttp1/2Request functions.

PRs are welcome