Net

external interface Net(source)

Properties

Link copied to clipboard
abstract val online: Boolean

A boolean property. Whether there is currently internet connection.

Functions

Link copied to clipboard
abstract fun fetch(input: String, init: NetFetchInit = definedExternally): Promise<GlobalResponse>
abstract fun fetch(input: GlobalRequest, init: NetFetchInit = definedExternally): Promise<GlobalResponse>

see Response.

Link copied to clipboard
abstract fun isOnline(): Boolean

Whether there is currently internet connection.

Link copied to clipboard
abstract fun request(options: String): ClientRequest

Creates a ClientRequest instance using the provided options which are directly forwarded to the ClientRequest constructor. The net.request method would be used to issue both secure and insecure HTTP requests according to the specified protocol scheme in the options object.

Link copied to clipboard
abstract fun resolveHost(host: String, options: ResolveHostOptions = definedExternally): Promise<ResolvedHost>

Resolves with the resolved IP addresses for the host.