# GetAssetBundle

> Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

## Definition

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

## GetAssetBundle(string)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(string uri)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The URI of the asset bundle to download.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(Uri)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(Uri uri)
```

### Parameters

**** (\[Uri]\(https\://learn.microsoft.com/dotnet/api/system.uri)): The URI of the asset bundle to download.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(string, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(string uri, uint crc)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The URI of the asset bundle to download.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(Uri, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(Uri uri, uint crc)
```

### Parameters

**** (\[Uri]\(https\://learn.microsoft.com/dotnet/api/system.uri)): The URI of the asset bundle to download.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(string, uint, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(string uri, uint version, uint crc)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The URI of the asset bundle to download.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle.Analogous to the version parameter for [WWW.LoadFromCacheOrDownload](/engine/6000.0/script-reference/unityengine/www/loadfromcacheordownload.md).**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(Uri, uint, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(Uri uri, uint version, uint crc)
```

### Parameters

**** (\[Uri]\(https\://learn.microsoft.com/dotnet/api/system.uri)): The URI of the asset bundle to download.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): An integer version number, which will be compared to the cached version of the asset bundle to download. Increment this number to force Unity to redownload a cached asset bundle.Analogous to the version parameter for [WWW.LoadFromCacheOrDownload](/engine/6000.0/script-reference/unityengine/www/loadfromcacheordownload.md).**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(string, Hash128, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(string uri, Hash128 hash, uint crc = 0)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The URI of the asset bundle to download.**** (\[Hash128]\(/engine/6000.0/script-reference/unityengine/hash128)): A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(Uri, Hash128, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(Uri uri, Hash128 hash, uint crc = 0)
```

### Parameters

**** (\[Uri]\(https\://learn.microsoft.com/dotnet/api/system.uri)): The URI of the asset bundle to download.**** (\[Hash128]\(/engine/6000.0/script-reference/unityengine/hash128)): A version hash. If this hash does not match the hash for the cached version of this asset bundle, the asset bundle will be redownloaded.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(string, CachedAssetBundle, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(string uri, CachedAssetBundle cachedAssetBundle, uint crc = 0)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The URI of the asset bundle to download.**** (\[CachedAssetBundle]\(/engine/6000.0/script-reference/unityengine/cachedassetbundle)): A structure used to download a given version of AssetBundle to a customized cache path.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```

## GetAssetBundle(Uri, CachedAssetBundle, uint)

Creates a UnityWebRequest optimized for downloading a Unity Asset Bundle via HTTP GET.

```csharp
public static UnityWebRequest GetAssetBundle(Uri uri, CachedAssetBundle cachedAssetBundle, uint crc = 0)
```

### Parameters

**** (\[Uri]\(https\://learn.microsoft.com/dotnet/api/system.uri)): The URI of the asset bundle to download.**** (\[CachedAssetBundle]\(/engine/6000.0/script-reference/unityengine/cachedassetbundle)): A structure used to download a given version of AssetBundle to a customized cache path.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): If nonzero, this number will be compared to the checksum of the downloaded asset bundle data. If the CRCs do not match, an error will be logged and the asset bundle will not be loaded. If set to zero, CRC checking will be skipped.

### Returns

| Type                                                                                         | Description                                                       |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) | A UnityWebRequest configured to downloading a Unity Asset Bundle. |

### Remarks

This method creates a UnityWebRequest, sets the method to `GET` and sets the target URL to the string uri argument. Sets no other flags or custom headers.

This method attaches a [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) to the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md). This [DownloadHandler](/engine/6000.0/script-reference/unityengine/networking/downloadhandler.md) has a special [DownloadHandlerAssetBundle.assetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle/assetbundle.md) property, which can be used to extract the asset bundle once enough data has been downloaded and decoded to permit access to the resources inside the bundle.

In addition, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) streams data into a ringbuffer and decompresses the data on a worker thread, saving many memory allocations compared to downloading the data all at once.

If supplied with an integer version or Hash128 hash argument, the [DownloadHandlerAssetBundle](/engine/6000.0/script-reference/unityengine/networking/downloadhandlerassetbundle.md) will employ the Asset Bundle caching system. If an Asset Bundle has been cached and does not need to be redownloaded, then the [UnityWebRequest](/engine/6000.0/script-reference/unityengine/networking/unitywebrequest.md) will complete once the Asset Bundle has finished loading from the cache.

Cached AssetBundles are uniquely identified solely by the filename and version. All domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN.

Usually using the filename of the AssetBundle to generate the cache path is fine. But if there are different AssetBundles with the same last file name, cache conflicts happens. With CachedAssetBundle struct, you can use [CachedAssetBundle.name](/engine/6000.0/script-reference/unityengine/cachedassetbundle/name.md) to customized the cache path to avoid the cache conflicts. You can also utilize this to organize the cache data structure.

**Note**, that while you can use this API to load Asset Bundle from local storage (using file:// URI or jar:file// on Android), this is not recommended, use [AssetBundle.LoadFromFileAsync](/engine/6000.0/script-reference/unityengine/assetbundle/loadfromfileasync.md) instead.

### Examples

```csharp
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class MyBehaviour : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(GetText());
    }

    IEnumerator GetText()
    {
        using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("https://www.my-server.com/mybundle"))
        {
            yield return uwr.SendWebRequest();

            if (uwr.result != UnityWebRequest.Result.Success)
            {
                Debug.Log(uwr.error);
            }
            else
            {
                // Get downloaded asset bundle
                AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr);

                // Unload the AssetBundle 
                bundle.Unload(true);
            }
        }
    }
}
```
