Download large array of data from remote server to use in a script

I am trying to create a script that would download a list of ip addresses from server and then would add routing rules based on that list.
Is there a way to fetch page contents directly into variable? I’m looking for something equivalent to

$(wget -qO- http://server)

The list is quite large (~1Mb) so I can’t use the result if I save it to file. Turns out it’s not possible to read a file larger than 4Kb in 2017.
I don’t have control over how the data is formed on the server so I have to parse it locally after I get it. So I cant prepare it in any other format for this script.