Skip to content

Http.Get

method · Http · cAlgo.API

DesktopCLICloud

Performs a GET request to the specified URI.

Environment behaviour

Cloud — not supported. No request is sent. The response, or the callback, has IsSuccessful false, StatusCode 403 and Body null. No exception is thrown.

Overloads

Get(Uri uri)

Performs a GET request to the specified URI.

HttpResponse Get(Uri uri)
api.Http.Get(uri: Uri) -> HttpResponse

Parameters

Name C# type Python type Description
uri Uri Uri The URI that the GET request should be made to.

Returns HttpResponse — The HttpResponse object representing the result of the request.

Examples

var response = Http.Get(new Uri("https://api.example.com/quotes/EURUSD"));
if (response.IsSuccessful)
    Print(response.Body);
else
    Print("Request failed with status code {0}", response.StatusCode);
from System import Uri

response = api.Http.Get(Uri("https://api.example.com/quotes/EURUSD"))
if response.IsSuccessful:
    api.Print(response.Body)
else:
    api.Print(f"Request failed with status code {response.StatusCode}")

Get(string uri)

Performs a GET request to the specified URI.

HttpResponse Get(string uri)
api.Http.Get(uri: str) -> HttpResponse

Parameters

Name C# type Python type Description
uri string str The string containing the URI that the GET request should be made to.

Returns HttpResponse — The HttpResponse object representing the result of the request.

Examples

var response = Http.Get("https://api.example.com/quotes/EURUSD");
if (response.IsSuccessful)
    Print(response.Body);
else
    Print("Request failed with status code {0}", response.StatusCode);
response = api.Http.Get("https://api.example.com/quotes/EURUSD")
if response.IsSuccessful:
    api.Print(response.Body)
else:
    api.Print(f"Request failed with status code {response.StatusCode}")