Networking & web · BUILT-IN MODULE

net

HTTP/HTTPS networking through curl.

Quick start

use net
use net

body = try net.get "https://example.com"
try net.download "https://example.com/file.txt" "file.txt"

API reference

net.get url

GET an HTTP/HTTPS URL through curl. Fallible.

GET an HTTP/HTTPS URL through curl. 此操作可能失敗。
net.post url body

POST Text through curl. Fallible.

POST Text through curl. 此操作可能失敗。
net.post_json url json

POST JSON through curl. Fallible.

POST JSON through curl. 此操作可能失敗。
net.request method url body

General network request. Fallible.

General network request. 此操作可能失敗。
net.download url path

Download a URL to a file. Fallible.

下載 a URL to a file. 此操作可能失敗。