rhai-http 0.8.0

HTTP module for the rhai scripting language
Documentation

rhai-http

Crates.io License CI docs.rs

A Rhai package that exposes a simple http API to make requests. Uses rhai-autodocs to build documentation for the Rhai API.

Simple GET request

let client = http::client();

client.request(#{ method: "GET", url: "http://example.com" })

GET request with headers and JSON output

let client = http::client();

client.request(#{
    "method": "GET",
    "url": "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?slug=bitcoin&convert=EUR",
    "headers": [
        "X-CMC_PRO_API_KEY: xxx",
        "Accept: application/json"
    ],
    "output": "json",
})