Networking & web · BUILT-IN MODULE

http

HTTP client helpers.

Quick start

use http
use http

body = try http.get "http://example.com"
say body

API reference

http.get url

Perform an HTTP GET request. Fallible.

執行 an HTTP GET request. 此操作可能失敗。
http.post url body

Perform an HTTP POST request. Fallible.

執行 an HTTP POST request. 此操作可能失敗。
http.post_json url json

POST a JSON body. Fallible.

POST a JSON body. 此操作可能失敗。
http.request method url body

Perform a general HTTP request. Fallible.

執行 a general HTTP request. 此操作可能失敗。