In C # Core, HttpClient () is used instead of WebClient (). I can't figure out how to send the data now. Below is an example using WebClient ():
private void SendMessage(string message, int chatId) { using (var webClient = new WebClient()) { var pars = new System.Collections.Specialized.NameValueCollection(); pars.Add("text", message); pars.Add("chat_id", chatId.ToString()); webClient.UploadValues(Link + "/sendMessage", pars); } }