0
ASP.NETサーバーでポストボディを取得しようとしていますが、ボディを受け取っていません。ポストボディを正しく取得する方法C#
これは私のコントローラ
[HttpPost]
public Boolean ReleaseProtection([FromBody]string value)
{
System.Diagnostics.Debug.WriteLine("returning value");
System.Diagnostics.Debug.WriteLine(value);
return true;
}
である私はnodeJSサーバにpost
に同じ方法を使用する場合はこれが私のクライアントのC#スクリプト
var credentials = new Dictionary<string, string>()
{
{"token", Token.Value},
{"repoId", repoId}
};
var content = new FormUrlEncodedContent(credentials);
var response = await client.PostAsync(Ribbon1.DOTNETHOSTURL + "api/excel/ReleaseProtection", content);
var responseString = await response.Content.ReadAsStringAsync();
あり、それはメッセージの罰金が、[FormBody] string value
戻り、空の文字列を受け取ります。どうしてこれなの?ここで