Plugin.Http
property · Plugin · cAlgo.API
DesktopCLICloud
Send HTTP requests.
Environment behaviour
CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.
Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.
Definition
public Http Http {get;}
api.Http: Http
Returns Http
Examples
var response = Http.Get("https://ctrader.com/");
if (response.IsSuccessful)
Print("Received {0} characters", response.Body.Length);
else
Print("Request failed with status code {0}", response.StatusCode);
response = api.Http.Get("https://ctrader.com/")
if response.IsSuccessful:
api.Print(f"Received {len(response.Body)} characters")
else:
api.Print(f"Request failed with status code {response.StatusCode}")