HTTP

Sidef can load and use Perl modules:

require('HTTP::Tiny')

func get(url) {
    static ua = %O<HTTP::Tiny>.new(agent => 'Mozilla/5.0')
    var resp = ua.get(url)
    if (resp{:success}) {
        return resp{:content}.decode_utf8
    }
    return nil
}

say get("http://example.net")

Last updated