import { Client } from "https://deno.land/x/arubaos_cx@v1.0.2/mod.ts";
Contains methods for logging in/out and making authenticated requests. Recommended for multiple requests.
Example:
import { Client } from "https://deno.land/x/arubaos_cx@$VERSION/mod.ts";
const client = new Client({ host: "10.20.30.40" });
await client.login();
const response1 = await client.fetch("/system");
const response2 = await client.fetch("/firmware");
await client.logout();
Methods
fetch(path: string, init?: RequestInit): Promise<Response>
Performs an authenticated request.
fetchOnce(path: string, init?: RequestInit): Promise<Response>
Performs a request inbetween automatic login/logout.
login(): Promise<void>
Logs the user in and stores the authentication cookie.
logout(): Promise<void>
Logs the user out and removes the authentication cookie.