NAME

Zuzu::Module::HTTP - std/net/http bindings for ZuzuScript.

DESCRIPTION

Implements the std/net/http module and exports CookieJar, Request, Response, and UserAgent.

CLASSES

CookieJar

Cookie storage abstraction used by UserAgent. Uses HTTP::CookieJar when available, otherwise a basic in-memory fallback.

Methods:

  • add(url, set_cookie)

  • cookie_header(url)

  • clear()

Response

Wrapper around an HTTP response hash.

Methods include status, reason, url, content, headers, header(name), success, json, expect_success, validate_json, and to_Dict.

Request

Mutable request builder used by UserAgent.

Methods include method, url, header, headers, query, body, json, auth_bearer, timeout, retries, download_to, upload_from, multipart, and send(user_agent).

UserAgent

Wrapper around HTTP::Tiny.

Methods include build_request(method, url), send(request), request(method, url, data?, headers?), plus shorthand methods get, head, delete, post, put, patch, and options.

COPYRIGHT AND LICENCE

Zuzu::Module::HTTP is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.