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

**URL:** https://discourse.julialang.org/t/http-streamed-response-bufferedinputstream-http-http-stream-warning/105777
**Category:** New to Julia
**Tags:** http
**Created:** [November 3, 2023, 8:50pm UTC](https://discourse.julialang.org/t/http-streamed-response-bufferedinputstream-http-http-stream-warning/105777 "2023-11-03T20:50:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JohnDuffy](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@JohnDuffy](https://discourse.julialang.org/u/JohnDuffy)
#### Post date: [November 3, 2023, 8:50pm UTC](https://discourse.julialang.org/t/http-streamed-response-bufferedinputstream-http-http-stream-warning/105777/1 "2023-11-03T20:50:09Z")

</div>

Hi

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

```julia
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:

```julia
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

---

<div class="post-metadata">

### Author: ![JohnDuffy](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@JohnDuffy](https://discourse.julialang.org/u/JohnDuffy)
#### Post date: [November 3, 2023, 9:39pm UTC](https://discourse.julialang.org/t/http-streamed-response-bufferedinputstream-http-http-stream-warning/105777/2 "2023-11-03T21:39:06Z")

</div>

I have cleared the warning with…

```julia
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
