62,046
社区成员
发帖
与我相关
我的任务
分享
context.Request.Form.Tostring()
function test1() {
$.ajax({
url: "http://localhost:27920/api/test",
type: "post",
cache: false,
data:{ text:"dfas"},
success:function(rs){
alert(rs);
}
})
}
后台我找你给的方法写的,data最后还是"" , 至少应该能获取到 text=dfas 啊 Stream stream = Stream.Null;
HttpContent content = this.Request.Content;
Task readTask = content.ReadAsStreamAsync().ContinueWith((task) => { stream = task.Result; });
readTask.Wait();
string data = string.Empty;
using (StreamReader reader = new StreamReader(stream))
{
data = reader.ReadToEnd();
}