getContent

Call GET, and return response content. This is the simplest case, when all you need is the response body.

getContent
(
A...
)
(
string url
,)

Return Value

Type: auto

Buffer!ubyte which you can use as ForwardRange or DirectAccessRange, or extract data with .data() method.

Examples

import std.algorithm;
globalLogLevel(LogLevel.info);
info("Test getContent");
auto r = getContent("https://httpbin.org/stream/20");
assert(r.splitter('\n').filter!("a.length>0").count == 20);
r = getContent("ftp://speedtest.tele2.net/1KB.zip");
assert(r.length == 1024);

Meta