<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebDocumentRepresentation/receivedData(_:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebDocumentRepresentation(im)receivedData:withDataSource:"
  },
  "title" : "receivedData(_:with:)"
}
-->

# receivedData(_:with:)

Invoked when a data source has received some data.

```
func receivedData(_ data: Data!, with dataSource: WebDataSource!)
```

## Parameters

`data`

An `NSData` object containing the data received.

`dataSource`

A `WebDataSource` object that identifies the request that generated this data.

## Discussion

Data is loaded incrementally, so this method may be invoked multiple times. The receiver is responsible for accumulating this data.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)