# GetData()

> Callback, invoked when the _data property is accessed.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Networking](/engine/6000.7/script-reference/unityengine/networking.md)
* **Assembly:** UnityEngine.UnityWebRequestModule

```csharp
protected virtual byte[] GetData()
```

### Returns

| Type                                                           | Description                                                                                                                                 |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [byte\[\]](https://learn.microsoft.com/dotnet/api/system.byte) | Byte array to return as the value of the [\_data](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/data.md) property. |

### Remarks

The return value of this method will be returned as the value of the [\_data](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/data.md) property.

This method will be invoked on the main thread.

If not overridden, the default behavior of this callback is to return `null`.
