---
id: "M:cAlgo.API.HttpRequestHeaders.GetValue(System.String)"
kind: "method"
type: "T:cAlgo.API.HttpRequestHeaders"
url: "https://help.ctrader.com/ctrader-algo/references/HTTP/HttpRequestHeaders/GetValue/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# HttpRequestHeaders.GetValue

Member of [HttpRequestHeaders](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpRequestHeaders/index.md).

## GetValue(string name)

Returns an existing header value.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public string GetValue(string name)
```

Python:

```python
httpRequestHeaders.GetValue(name: str) -> str
```

### Parameters

- `name` (`string`, Python `str`): The Header name

### Returns

`string` — The Header value if the header is successfully found; otherwise, an empty string.

### Examples

C#:

```csharp
var request = new HttpRequest(new Uri("https://api.example.com/quotes"));
request.Headers.Add("Accept", "application/json");
Print("Accept: {0}", request.Headers.GetValue("Accept"));
```

Python:

```python
from System import Uri

request = HttpRequest(Uri("https://api.example.com/quotes"))
request.Headers.Add("Accept", "application/json")
api.Print(f"Accept: {request.Headers.GetValue('Accept')}")
```

