# GetText()

> Callback, invoked when the _text property is accessed.

## Definition

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

```csharp
protected virtual string GetText()
```

### Returns

| Type                                                           | Description                                                                                                                                    |
| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | String to return as the return value of the [\_text](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/text.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 call [DownloadHandler.GetData()](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/getdata.md). If [DownloadHandler.GetData()](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/getdata.md) returns `null` or an empty string, then this method will return `null` or an empty string (respectively). Otherwise, this method will decode the byte array returned from [DownloadHandler.GetData()](/engine/6000.7/script-reference/unityengine/networking/downloadhandler/getdata.md) as a UTF8 string and return the decoded string.
