Set the event handler that receives incoming headers.
The callback will receive a header field key, value as parameter. The const(char)[] arrays are not valid after the delegate has returned.
import std.net.curl, std.stdio, std.conv; auto http = HTTP("dlang.org"); http.onReceive = (ubyte[] data) { writeln(to!(const(char)[])(data)); return data.length; }; http.onReceiveHeader = (in char[] key, in char[] value) { writeln(key, " = ", value); }; http.perform();
See Implementation
Set the event handler that receives incoming headers.
The callback will receive a header field key, value as parameter. The const(char)[] arrays are not valid after the delegate has returned.