My code is as follows:
public class TensorTest : Indicator { protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @""; Name = "Test"; Calculate = Calculate.OnBarClose; IsOverlay = true; } else if (State == State.Configure) { Task<string> response = SendPOST(); Print(response.Result); } } private static async Task<string> SendPOST() { var responseContent = ""; var url = "http://localhost:5000/app"; var content = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("input", "val1,val2"), }); using (var httpClient = new HttpClient()) { var response = await httpClient.PostAsync(url, content); responseContent = await response.Content.ReadAsStringAsync(); } return responseContent; } }
Comment