• .net Core 调用api里的post方法之 form传值


                HttpClient client = new HttpClient();
                client.Timeout = new TimeSpan(0, 45, 0);
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("multipart/form-data"));
                MultipartFormDataContent content = new MultipartFormDataContent();
                content.Add(new StringContent("1"), "pageIndex");
                content.Add(new StringContent("25"), "pageSize");
                
                var result = client.PostAsync(url, content).Result.Content.ReadAsStringAsync().Result;
  • 相关阅读:
    每日总结
    团队冲刺9
    团队冲刺8
    团队冲刺7
    团队冲刺6
    团队冲刺5
    团队冲刺4
    团对冲刺3
    团队冲刺2
    每日博客
  • 原文地址:https://www.cnblogs.com/wjx-blog/p/14106213.html
Copyright © 2020-2023  润新知