如何使用 HttpClient 调用具有多个参数的 Post 方法?
我正在使用带有单个参数的以下代码:
var paymentServicePostClient = new HttpClient();
paymentServicePostClient.BaseAddress =
new Uri(ConfigurationManager.AppSettings["PaymentServiceUri"]);
PaymentReceipt payData = SetPostParameter(card);
var paymentServiceResponse =
paymentServicePostClient.PostAsJsonAsync("api/billpayment/", payData).Result;
我需要添加另一个参数 userid。如何将参数与“postData”一起发送?
WebApi POST 方法原型:
public int Post(PaymentReceipt paymentReceipt,string userid)