string Username = "***";
string Password = "***";
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{Username}:{Password}")));
HttpContent httpContent = new StringContent(stri, Encoding.UTF8);
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
Uri address = new Uri("***"); //URL
msg = client.PostAsync(address, httpContent).Result.Content.ReadAsStringAsync().Result;//返回值
}