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

# fetchData(of:completionHandler:)

## Declaration

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

```swift
func fetchData(of dataTypes: WKWebViewDataType) async throws -> Data
```
