HTTP Streamed Response BufferedInputStream(http::HTTP.Stream) Warning

Hi

I’m streaming JSON from a REST API successfully (it appears) using:

HTTP.open(:GET, url, headers) do http
    for line in eachline(http)
        print(line)
    end
end

However, I getting this warning at the beginning of my output:

Warning: Reading one byte at a time from HTTP.Stream is inefficient.
│ Use: io = BufferedInputStream(http::HTTP.Stream) instead.
│ See: https://github.com/BioJulia/BufferedStreams.jl
└ @ HTTP.Streams ~/.julia/packages/HTTP/SN7VW/src/Streams.jl:240

I understand the gist of what it is saying, but I’m not sure how to implement the suggestion.

Any help would be much appreciated.

Kind regards

I have cleared the warning with…

HTTP.open(:GET, url, headers) do http
        for line in eachline(BufferedInputStream(http::HTTP.Stream))
            print(line)
        end
    end

… which I believe is wrapping the HTTP response in an appropriate buffer for calling readline().

A sanity check by someone who knows what they are doing would be very much appreciated.

Kind regards