C# 使用参数重定向URL(POST方法)

C# 使用参数重定向URL(POST方法),c#,asp.net-core,redirect,C#,Asp.net Core,Redirect,我想调用webapiPOST方法,但它会将窗口重定向到另一个页面而不返回任何内容。我能用什么 我尝试使用响应.重定向(URL),但无法传递参数。我尝试了HttpClient client=new HttpClient()调用web api post方法,但它不会将窗口重定向到其他页面 在JavaScript中,我使用了 $.redirect('https://livinggateway.azurewebsites.net/LivingPayment/CardPayment“,{'orderId'

我想调用webapi
POST方法
,但它会将窗口重定向到另一个页面而不返回任何内容。我能用什么

我尝试使用
响应.重定向(URL)
,但无法传递参数。我尝试了
HttpClient client=new HttpClient()
调用web api post方法,但它不会将窗口重定向到其他页面

在JavaScript中,我使用了
$.redirect('https://livinggateway.azurewebsites.net/LivingPayment/CardPayment“,{'orderId':data.data,'paymentAmount':parseFloat($('.CardTotalAmount').val())},'POST')

但在控制器中,我不知道

///控制器调用api的代码

using (HttpClient client= new HttpClient())
{
   client.BaseAddress = new Uri("https://URL");

var content = BuildContent(new
{
   orderId = secondResponseResult.data,
   paymentAmount = paymentCC.txnAmountWithCharges
});

client.PostAsJsonAsync("https://URL", content).;
}

我不清楚!该API调用成功吗?Web API用于交换数据。。。。不建议从Web API重定向到URL。。。。如果用户未登录,您应该从API返回401响应。Hi@PrashantPimpale,API正在成功运行。如果成功,应该将窗口重定向到另一个url。然后使用我现在想在控制器中执行的操作。