HTTP.onReceiveHeader

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.

struct HTTP
@property
void
onReceiveHeader
(
void delegate
(
in char[] key
,
in char[] value
)
callback
)

Examples

import std.net.curl, std.stdio;
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();

Meta

Suggestion Box / Bug Report