# GetTexture

> Creates a UnityWebRequest intended to download an image via HTTP GET and create a Texture based on the retrieved data.

## Definition

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

## GetTexture(string)

Creates a [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) intended to download an image via HTTP GET and create a [Texture](/engine/6000.7/script-reference/unityengine/texture.md) based on the retrieved data.

> **Warning:**
>
> **Removed.** UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead
>
> **Upgrade to** [GetTexture](/engine/6000.7/script-reference/unityengine/networking/unitywebrequesttexture/gettexture.md)

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

### Parameters

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

### Returns

| Type                                                                                         | Description                                                                                                                                                                                                                    |
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) | A [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) properly configured to download an image and convert it to a [Texture](/engine/6000.7/script-reference/unityengine/texture.md). |

### Remarks

**Obsolete** - instead use [UnityWebRequestTexture.GetTexture](/engine/6000.7/script-reference/unityengine/networking/unitywebrequesttexture/gettexture.md).

This method creates a [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) and sets the target URL to the string `uri` argument. This method sets no other flags or custom headers.

This method attaches a [DownloadHandlerTexture](/engine/6000.7/script-reference/unityengine/networking/downloadhandlertexture.md) object to the [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md). [DownloadHandlerTexture](/engine/6000.7/script-reference/unityengine/networking/downloadhandlertexture.md) is a specialized [DownloadHandler](/engine/6000.7/script-reference/unityengine/networking/downloadhandler.md) which is optimized for storing images which are to be used as textures in the Unity Engine. Using this class significantly reduces memory reallocation compared to downloading raw bytes and creating a texture manually in script. In addition, texture conversion will be performed on a worker thread.

This method attaches no [UploadHandler](/engine/6000.7/script-reference/unityengine/networking/uploadhandler.md) to the [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md).

UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead.

## GetTexture(string, bool)

Creates a [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) intended to download an image via HTTP GET and create a [Texture](/engine/6000.7/script-reference/unityengine/texture.md) based on the retrieved data.

> **Warning:**
>
> **Removed.** UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead
>
> **Upgrade to** [GetTexture](/engine/6000.7/script-reference/unityengine/networking/unitywebrequesttexture/gettexture.md)

```csharp
public static UnityWebRequest GetTexture(string uri, bool nonReadable)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The URI of the image to download.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If true, the texture's raw data will not be accessible to script. This can conserve memory. Default: `false`.

### Returns

| Type                                                                                         | Description                                                                                                                                                                                                                    |
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) | A [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) properly configured to download an image and convert it to a [Texture](/engine/6000.7/script-reference/unityengine/texture.md). |

### Remarks

**Obsolete** - instead use [UnityWebRequestTexture.GetTexture](/engine/6000.7/script-reference/unityengine/networking/unitywebrequesttexture/gettexture.md).

This method creates a [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md) and sets the target URL to the string `uri` argument. This method sets no other flags or custom headers.

This method attaches a [DownloadHandlerTexture](/engine/6000.7/script-reference/unityengine/networking/downloadhandlertexture.md) object to the [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md). [DownloadHandlerTexture](/engine/6000.7/script-reference/unityengine/networking/downloadhandlertexture.md) is a specialized [DownloadHandler](/engine/6000.7/script-reference/unityengine/networking/downloadhandler.md) which is optimized for storing images which are to be used as textures in the Unity Engine. Using this class significantly reduces memory reallocation compared to downloading raw bytes and creating a texture manually in script. In addition, texture conversion will be performed on a worker thread.

This method attaches no [UploadHandler](/engine/6000.7/script-reference/unityengine/networking/uploadhandler.md) to the [UnityWebRequest](/engine/6000.7/script-reference/unityengine/networking/unitywebrequest.md).

UnityWebRequest.GetTexture is obsolete. Use UnityWebRequestTexture.GetTexture instead.
