the callback that receives the ubyte[] data. Be sure to copy the incoming data and not store a slice.
The callback returns the incoming bytes read. If not the entire array is the request will abort. The special value HTTP.pauseRequest can be returned in order to pause the current request.
import std.net.curl, std.stdio, std.conv; Curl curl; curl.initialize(); curl.set(CurlOption.url, "http://dlang.org"); curl.onReceive = (ubyte[] data) { writeln("Got data", to!(const(char)[])(data)); return data.length;}; curl.perform();
The event handler that receives incoming data.