Skip to content

Function: deleteResource

deleteResource(uri, options?): Promise\<DeleteResult>

Deletes a resource on a Pod at a given URL.

Parameters

Name Type Description
uri string The URI for the resource that should be deleted
options? DatasetRequestOptions Options to provide a fetch function and a local dataset to update.

Returns

Promise\<DeleteResult>

a DeleteResult

Example

deleteResource will send a request to a Solid Pod using the provided fetch function. A local dataset can also be provided. It will be updated with any new information from the delete.

import { deleteResource } from "@ldo/solid";
import { createDataset } from "@ldo/dataset"
import { fetch } from "@inrupt/solid-client-autn-js";

const localDataset = createDataset();
const result = await deleteResource(
  "https://example.com/container/someResource.ttl",
  { fetch, dataset: localDataset },
);
if (!result.isError) {
  // Do something
}

Defined in

packages/solid/src/requester/requests/deleteResource.ts:49