---
title: "fetchData(of:completionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebsitedatastore/fetchdata(of:completionhandler:)"
---

# fetchData(of:completionHandler:)

## Declaration

```swift
func fetchData(of dataTypes: Set<String>, completionHandler: @escaping @MainActor @Sendable (Data?, (any Error)?) -> Void)
```

```swift
func fetchData(of dataTypes: Set<String>) async throws -> Data
```
