Request.useStreaming

set "streaming" property v = value to set (true - use streaming).

Use streaming when you do not want to keep whole response in memory.

struct Request
@property pure @nogc nothrow
void
useStreaming
(
bool v
)

Examples

import requests;
import std.stdio;

void main() {
    Request rq = Request();

    rq.useStreaming = true;
    auto rs = rq.get("http://example.com/SomeHugePicture.png");
    auto stream = rs.receiveAsRange();
    File file = File("SomeHugePicture.png", "wb");

    while(!stream.empty)  {
        file.rawWrite(stream.front);
        stream.popFront;
    }
    file.close();
}

Meta