1 回答

TA貢獻(xiàn)1820條經(jīng)驗(yàn) 獲得超10個(gè)贊
我已經(jīng)解決了這個(gè)問題..我仍然不知道真正的問題是什么,但下面的代碼正在工作..
public void Test(string content)
{
using (var client = new HttpClient())
{
try
{
var res = client.PostAsync("http://localhost:4000/api/activation/activate",
new StringContent(content, Encoding.UTF8, "application/json");
res.Result.EnsureSuccessStatusCode();
Console.WriteLine("Response " + res.Result.Content.ReadAsStringAsync().Result +
Environment.NewLine);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
所以它與nodejs無關(guān),而是c#方面。
- 1 回答
- 0 關(guān)注
- 121 瀏覽
添加回答
舉報(bào)