May 2019
Beginner to intermediate
466 pages
10h 44m
English
Since we just confirmed that we have a response body, let's see it:
julia> resp.body
193324-element Array{UInt8,1}:
0x3c
0x21
0x44
# ... output truncated ...
Oops, that doesn't look like the web page we were expecting. No worries though, these are the bytes of the raw response—which we can easily convert to a human-readable HTML string. Remember that I mentioned the String method when learning about strings? Well, this is where it comes in handy:
julia> resp_body = String(resp.body)
Your REPL should now be outputting a long HTML string that represents Julia's Wikipedia page.
If we take a look at the first 500 characters, we'll start to see familiar patterns:
julia> resp_body[1:500]
The output is as follows:
Sure enough, ...
Read now
Unlock full access