var httpClient = new HttpClient(); //实例化一个请求对象
httpClient.DefaultRequestHeaders.Add("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJYVENfUUwiLCJhdWQiOiJBbGwiLCJpYXQiOiIyMDIyLzExLzE0IDk6MTc6MDAgKzA4OjAwIiwiZXhwIjoiMjAyMi8xMS8xNCAxMToxNzowMCArMDg6MDAiLCJqdGkiOiIyMDIyMTExNDA5MTcwMCIsIlJlY0lkIjoiMSIsIlN0YXRlIjoiMCIsIlVzZXJJZCI6IlN5c0FkbWluIiwiVXNlck5hbWUiOiLns7vnu5_nrqHnkIblkZgiLCJDb21wYW55SWQiOiJTWVMiLCJDb21wYW55TmFtZSI6Iuezu-e7nyIsIkNvbXBhbnlGdWxsTmFtZSI6Iuezu-e7n-euoeeQhuWRmOWMuuWfnyIsIkxvZ2luRGF0ZVRpbWUiOiIyMDIyLzExLzE0IDk6MTc6MDAiLCJJc1N5c0FkbWluIjoiVHJ1ZSIsIklzQWRtaW4iOiJUcnVlIiwiUm9sZUlkcyI6IlN5c0FkbWluIiwiUm9sZU5hbWVzIjoi57O757uf566h55CG5ZGYIiwiQ2FjaGVUaW1lIjoiMjAyMi8xMS8xNCA5OjE3OjAwIiwiUGFzc1dvcmQiOiIiLCJJcE5hbWUiOiIiLCJJcEFkZHJlc3MiOiIiLCJVc2VyVGFibGUiOiJFbnRpdGllcy5TeXNfVXNlclRhYmxlIiwiUm9sZUxpc3QiOiJTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYy5MaXN0YDFbRW50aXRpZXMuU3lzX1JvbGVdIiwiQ29tcGFueVRhYmxlTGlzdCI6IlN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtFbnRpdGllcy5TeXNfQ29tcGFueVRhYmxlXSJ9.LOTdC4rax9XCj2wV49tzphtz0RD49jEOLlhZVqN52oQ");//添加请求头的相关内容
HttpContent content = new StringContent(JsonConvert.SerializeObject(parameters), Encoding.UTF8, "application/json");//设置请求体(请求内容,编码,格式)
var response = await httpClient.PostAsync("http://localhost:36123/api/demo/Test/upload", content);//发起请求
var msg = "";
if (response.StatusCode==HttpStatusCode.OK) {
msg= await response.Content.ReadAsStringAsync();//读取响应的内容
}