📜  webclient c# 示例帖子 - C# 代码示例

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

代码示例2
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);
}