# DownloadHandler

> Manage and process HTTP response body data received from a remote server.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.Networking](/engine/6000.7/script-reference/unityengine/networking.md)
* **Assembly:** UnityEngine.UnityWebRequestModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class DownloadHandler : IDisposable
```

## Remarks

DownloadHandler objects are helper objects. When attached to a [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md), they define how to handle HTTP response body data received from a remote server. Generally, they are used to buffer, stream and/or process response bodies.

DownloadHandler is a base class. Depending on usage scenario, different specialized classes are available. [DownloadHandlerBuffer](/engine/6000.7/script-reference/unityengine/networking/downloadhandlerbuffer.md) provides basic buffering, while [DownloadHandlerTexture](/engine/6000.7/script-reference/unityengine/networking/downloadhandlertexture.md) and [DownloadHandlerAssetBundle](/engine/6000.7/script-reference/unityengine/networking/downloadhandlerassetbundle.md) provide more efficient solutions for [Texture](/engine/6000.7/script-reference/unityengine/texture.md) and [AssetBundle](/engine/6000.7/script-reference/unityengine/assetbundle.md) downloads.

For custom use cases, see [DownloadHandlerScript](/engine/6000.7/script-reference/unityengine/networking/downloadhandlerscript.md).

Additional Resources: [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md), [DownloadHandlerBuffer](/engine/6000.7/script-reference/unityengine/networking/downloadhandlerbuffer.md), [DownloadHandlerTexture](/engine/6000.7/script-reference/unityengine/networking/downloadhandlertexture.md), [DownloadHandlerAudioClip](/engine/6000.7/script-reference/unityengine/networking/downloadhandleraudioclip.md), [DownloadHandlerAssetBundle](/engine/6000.7/script-reference/unityengine/networking/downloadhandlerassetbundle.md), [DownloadHandlerScript](/engine/6000.7/script-reference/unityengine/networking/downloadhandlerscript.md)

## Properties

| Property                                                                                           | Description                                                                                                                                                                                                                                                                                     |
| -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [data](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/data.md)             | Returns the raw bytes downloaded from the remote server, or `null`. (Read Only)                                                                                                                                                                                                                 |
| [error](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/error.md)           | Error message describing a failure that occurred inside the download handler.                                                                                                                                                                                                                   |
| [isDone](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/isdone.md)         | Returns `true` if this DownloadHandler has been informed by its parent [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) that all data has been received, and this DownloadHandler has completed any necessary post-download processing. (Read Only) |
| [nativeData](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/nativedata.md) | Provides direct access to downloaded data.                                                                                                                                                                                                                                                      |
| [text](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/text.md)             | Convenience property. Returns the bytes from [\_data](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/data.md) interpreted as a UTF8 string. (Read Only)                                                                                                                 |

## Methods

| Method                                                                                                                             | Description                                                                                                                                                                            |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CompleteContent](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/completecontent.md)                       | Callback, invoked when all data has been received from the remote server.                                                                                                              |
| [Dispose](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/dispose.md)                                       | Signals that this [DownloadHandler](/engine/6000.7/script-reference/unityengine/networking/downloadhandler.md) is no longer being used, and should clean up any resources it is using. |
| [GetData](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/getdata.md)                                       | Callback, invoked when the [\_data](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/data.md) property is accessed.                                              |
| [GetNativeData](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/getnativedata.md)                           | Provides allocation-free access to the downloaded data as a NativeArray.                                                                                                               |
| [GetProgress](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/getprogress.md)                               | Callback, invoked when [\_downloadProgress](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest/downloadprogress.md) is accessed.                                   |
| [GetText](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/gettext.md)                                       | Callback, invoked when the [\_text](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/text.md) property is accessed.                                              |
| [ReceiveContentLengthHeader](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/receivecontentlengthheader.md) | Callback, invoked with a `Content-Length` header is received.                                                                                                                          |
| [ReceiveData](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/receivedata.md)                               | Callback, invoked as data is received from the remote server.                                                                                                                          |
