using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
var url = "https://www.xxxx.com/info/info-add-ok_soft.php";
var data = new
{
title2 = "arduino",
classid = "3",
title = "标题",
keywords = "关键词",
description = "备注",
text = "<p>xxx<br/></p><pre class=\"brush:cpp;toolbar:false\">内容</pre><p><br/></p>",
state = "1"
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
using (var client = new HttpClient())
{
var response = await client.PostAsync(url, content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询