---
title: cancel()
framework: linkpresentation
role: symbol
role_heading: Instance Method
path: linkpresentation/lpmetadataprovider/cancel()
---

# cancel()

Cancels a metadata request.

## Declaration

```swift
func cancel()
```

## Discussion

Discussion This method invokes the completion handler with the error code LPError.Code.metadataFetchCancelled if the request hasn’t already completed.

## See Also

### Fetching metadata

- [startFetchingMetadata(for:completionHandler:)](linkpresentation/lpmetadataprovider/startfetchingmetadata(for:completionhandler:)-54z5i.md)
- [shouldFetchSubresources](linkpresentation/lpmetadataprovider/shouldfetchsubresources.md)
- [timeout](linkpresentation/lpmetadataprovider/timeout.md)
