# How to read Download response body string?

**URL:** <https://discourse.julialang.org/t/how-to-read-download-response-body-string/114996>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [May 31, 2024, 6:24am UTC](https://discourse.julialang.org/t/how-to-read-download-response-body-string/114996 "2024-05-31T06:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![listenmmm](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@listenmmm](https://discourse.julialang.org/u/listenmmm)\
**Post date:** [May 31, 2024, 6:24am UTC](https://discourse.julialang.org/t/how-to-read-download-response-body-string/114996/1 "2024-05-31T06:24:01Z")

</div>

# code

```julia
using Downloads

begin
  response_bpdy_io = IOBuffer()

  response = request(
    "https://httpbin.org/ip",
    method="GET",
    headers=Dict("accept" => "application/json"),
    verbose=true,
    output=response_bpdy_io,
  )

  @show response.status
  @show response.message

  @show readchomp(response_bpdy_io)
end

```

# output:

```julia-auto
response.status = 200
response.message = "HTTP/1.1 200 OK"
readchomp(response_bpdy_io) = ""

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [May 31, 2024, 6:38am UTC](https://discourse.julialang.org/t/how-to-read-download-response-body-string/114996/2 "2024-05-31T06:38:58Z")

</div>

> [@listenmmm](#):
>
> ` @show readchomp(response_bpdy_io)`

The `position` of the buffer will be at the end so you are just reading the empty string. You can `seekstart` to the beginning before reading:  
`readchomp(seekstart(response_body_io))`.
