От: | Shmj | ||
Дата: | 21.10.24 18:05 | ||
Оценка: |
Переделать C#-код на HttpClient
using (var webClient = new WebClient())
{
try
{
webClient.Headers[HttpRequestHeader.Authorization] = Properties.Settings.Default.ApiKey;
webClient.Headers.Add("Content-Type", "application/pdf");
retVal = webClient.UploadFile(url, "POST", filePath);
}
catch (WebException webEx)
{
retVal = null;
}
}
return Encoding.UTF8.GetString(retVal);