Это мой код;
Код: Выделить всё
public static class EmailService
{
private static WhistlerLogger _logger = new WhistlerLogger(typeof(EmailService));
public static bool SendNewPasswordTo(string email, string password)
{
try
{
using var client = new HttpClient();
client.BaseAddress = new Uri(Main.ServerConfig.MailService.Url);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain"));
return client.GetAsync($"?email={email}&password={password}").Result.StatusCode == System.Net.HttpStatusCode.OK;
}
catch (Exception e)
{
_logger.WriteError($"SendNewPasswordTo:\n{e}");
return false;
}
}
}[enter image description here](https://i.sstatic.net/xQNqPBiI.png)
Подробнее здесь: https://stackoverflow.com/questions/787 ... ly-respond