Skip to content

Function: checkRootContainer

checkRootContainer(uri, options?): Promise\<CheckRootResult>

Performs a request to the Pod to check if the given URI is a root container as defined in the solid specification section 4.1

Parameters

Name Type Description
uri ContainerUri the URI of the container resource
options? BasicRequestOptions options variable to pass a fetch function

Returns

Promise\<CheckRootResult>

CheckResourceSuccess if there is no error

Example

import { checkRootContainer } from "@ldo/solid";
import { fetch } from "@inrupt/solid-client-authn-browser";

const result = await checkRootContainer("https://example.com/", { fetch });
if (!result.isError) {
  // true if the container is a root container
  console.log(result.isRootContainer);
}

Defined in

packages/solid/src/requester/requests/checkRootContainer.ts:78