byLine

HTTP/FTP fetch content as a range of lines.

A range of lines is returned when the request is complete. If the method or other request properties is to be customized then set the conn parameter with a HTTP/FTP instance that has these properties set.

byLine
(
Conn = AutoProtocol
Terminator = char
Char = char
)
(
const(char)[] url
,
KeepTerminator keepTerminator = No.keepTerminator
,
Terminator terminator = '\n'
,
Conn conn = Conn()
)
if (
isCurlConn!Conn &&
&&
isSomeChar!Terminator
)

Parameters

url const(char)[]

The url to receive content from

keepTerminator KeepTerminator

Yes.keepTerminator signals that the line terminator should be returned as part of the lines in the range.

terminator Terminator

The character that terminates a line

conn Conn

The connection to use e.g. HTTP or FTP.

Return Value

Type: auto

A range of Char[] with the content of the resource pointer to by the URL

Examples

import std.net.curl, std.stdio;
foreach (line; byLine("dlang.org"))
    writeln(line);

Meta