---
id: "T:cAlgo.API.HttpResponse"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/"
---

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

# HttpResponse (class)

The class representing an HTTP response.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public sealed class HttpResponse
```

## Examples

C#:

```csharp
var response = Http.Get("https://api.example.com/quotes/EURUSD");
if (response.IsSuccessful)
    Print("Status: {0} | Content type: {1} | Body: {2}", response.StatusCode, response.Headers.GetValue("Content-Type"), response.Body);
else
    Print("Request failed: {0}", response.Exception?.Message);
```

Python:

```python
response = api.Http.Get("https://api.example.com/quotes/EURUSD")
if response.IsSuccessful:
    api.Print(f"Status: {response.StatusCode} | Content type: {response.Headers.GetValue('Content-Type')} | Body: {response.Body}")
elif response.Exception is not None:
    api.Print(f"Request failed: {response.Exception.Message}")
```

## Properties

- `public string Body {get;}` — Gets the body of the response. [details](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/Body/index.md)
- `public HttpException Exception {get;}` — Gets the exception thrown when sending HTTP request. [details](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/Exception/index.md)
- `public HttpResponseHeaders Headers {get;}` — Gets the headers contained in the response. [details](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/Headers/index.md)
- `public bool IsSuccessful {get;}` — Gets true if the response is successful, false otherwise. [details](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/IsSuccessful/index.md)
- `public int StatusCode {get;}` — Gets the response status code. [details](https://help.ctrader.com/ctrader-algo/references/HTTP/HttpResponse/StatusCode/index.md)

