























Talk is cheap,Show me the code.
.cshtml

let pdata = { "weight": 50, "origin": originSel.value, "destination": destinationSel.value };
let r = await axios.post("/search?handler=list" , pdata).catch(() => null);
console.log(r);

.cs 注意参数要加【FromBody】,get的话 OnGetList

public ActionResult OnPostList([FromBody]Ly.Model.FromBody.SearchRequestInfo requestInfo)
{
var list = _priceService.Search(requestInfo.Origin,requestInfo.Destination,requestInfo.Weight);
return new JsonResult(list);
}

此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。