【发布时间】:2017-12-10 05:57:43
【问题描述】:
我在通过参数化 url 从我的 Entires 发布数据时遇到问题,我不知道为什么会这样,该 URL 在发布后返回一条消息,下面是我的 URL:
这就是我发布数据的方式:
void OnSubmitReport(object sender, System.EventArgs e)
{
PostData();
}
public async void PostData()
{
string details = report_details_entry.Text;
string date = nextappointment_entry.Text;
var formContent = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("unm", USERNAME),
new KeyValuePair<string, string >("assinID", ""+ASSIGNID),
new KeyValuePair<string, string>("details", details),
new KeyValuePair<string, string>("appoi_date", date)
});
var response = await client.PostAsync("http://bbs.eamobiledirectory.com/Mobile/MobileApi.aspx?Action=NewSalesReport",formContent);
}
我想要的是在病房后提交条目中的数据,然后我在 DisplayAlert 消息中返回一条消息。
【问题讨论】:
-
您的示例显示的是 GET,而不是 POST。您确定需要使用 POST 吗?您代码中的参数名称也与示例 url 中显示的名称不匹配。
-
是的,我想发帖@Jason
标签: c# forms xamarin.forms http-post xamarin.forms.entry