// Should return an XML document on success
type Nextcloud = {
baseUrl: string;
username: string;
password: string;
};
export async function main(nextcloud_res: Nextcloud) {
const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
headers: {
Authorization:
"Basic " + btoa(nextcloud_res.username + ":" + nextcloud_res.password),
"OCS-APIRequest": "true",
},
});
if (!resp.ok) {
throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
}
return await resp.text();
}
Submitted by hugo697 3 days ago
// Should return an XML document on success
type Nextcloud = {
baseUrl: string;
username: string;
password: string;
};
export async function main(nextcloud_res: Nextcloud) {
const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
headers: {
Authorization:
"Basic " + btoa(nextcloud_res.username + ":" + nextcloud_res.password),
"OCS-APIRequest": "true",
},
});
if (!resp.ok) {
throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
}
return await resp.text();
}
Submitted by admin 635 days ago
// Should return an XML document on success
type Nextcloud = {
baseUrl: string;
username: string;
password: string;
};
export async function main(nextcloud_res: Nextcloud) {
const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
headers: {
'Authorization': 'Basic ' + btoa(nextcloud_res.username + ':' + nextcloud_res.password),
'OCS-APIRequest': 'true',
}
});
if (!resp.ok) {
throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
}
return await resp.text();
}
Submitted by admin 638 days ago
import * as wmill from "https://deno.land/x/windmill@v1.85.0/mod.ts"
// Should return an XML document on success
export async function main(nextcloud_res: wmill.Resource<"c_nextcloud">) {
const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
headers: {
'Authorization': 'Basic ' + btoa(nextcloud_res.user + ':' + nextcloud_res.password),
'OCS-APIRequest': 'true',
}
});
if (!resp.ok) {
throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
}
return await resp.text();
}
Submitted by adam186 767 days ago
import * as wmill from "https://deno.land/x/windmill@v1.70.1/mod.ts"
// Should return an XML document on success
export async function main(nextcloud_res: wmill.Resource<"c_nextcloud">) {
const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
headers: {
'Authorization': 'Basic ' + btoa(nextcloud_res.user + ':' + nextcloud_res.password),
'OCS-APIRequest': 'true',
}
});
if (!resp.ok) {
throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
}
return await resp.text();
}
Submitted by adam186 802 days ago
import * as wmill from "https://deno.land/x/windmill@v1.35.0/mod.ts"
// Should return an XML document on success
export async function main(nextcloud_res: wmill.Resource<"c_nextcloud">) {
const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
headers: {
'Authorization': 'Basic ' + btoa(nextcloud_res.user + ':' + nextcloud_res.password),
'OCS-APIRequest': 'true',
}
});
if (!resp.ok) {
throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
}
return await resp.text();
}
Submitted by jaller94 951 days ago