Http.setHost

Set the target host.

This function just stores the host address and port, it doesn't actually connect to it until you send a request. The port has a default value of 0, which means that the HTTP client will use the right port according to the protocol used (80 for HTTP, 443 for HTTPS). You should leave it like this unless you really need a port other than the standard one, or use an unknown protocol.

class Http
void
setHost
(
const(char)[] host
,
ushort port = 0
)

Parameters

host const(char)[]

Web server to connect to

port ushort

Port to use for connection

Meta