Edits history of script submission #162 for ' Get API capabilities (ocs)'

  • deno
    One script reply has been approved by the moderators
    Ap­pro­ved
    // https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api
    // Should return an XML document on success.
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          "OCS-APIRequest": "true",
        },
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by hugo697 380 days ago

  • deno
    // https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api
    // Should return an XML document on success.
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          "OCS-APIRequest": "true",
        },
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by admin 1013 days ago

  • deno
    
    // https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api
    // Should return an XML document on success.
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by admin 1016 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    // https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api
    // Should return an XML document on success.
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by adam186 1144 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    // https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api
    // Should return an XML document on success.
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by adam186 1179 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    // https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-api-overview.html#capabilities-api
    // Should return an XML document on success.
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by jaller94 1329 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    export async function main(baseUrl: string) {
      const resp = await fetch(`${baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by jaller94 1329 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    export async function main(baseUrl: string) {
      const resp = await fetch(`${basicauth_res.baseUrl}/ocs/v1.php/cloud/capabilities`, {
        headers: {
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by jaller94 1329 days ago