📜  httpclient 发布 c# 示例 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:45.878000             🧑  作者: Mango

代码示例3
using (var httpClient = new HttpClient())
        {
            httpClient.BaseAddress = new Uri("http://somesite.com");
            var content = new FormUrlEncodedContent(new[] 
            {
                new KeyValuePair("accountidentifier", accountID),
                new KeyValuePair("type", "add"),
                new KeyValuePair("seriesid", seriesId),

            });

            httpClient.PostAsync("/api/User_Favorites.php", content);
}