post数据包括:
1.request.form:(逐个获取表单提交的数据);
formcollection:
[httppost]
public async taskpostsendemail(formcollection collection)
{
var a=collection["name"]
return jsonconvert.deserializeobject(obj).tostring();
}
2.同名参数:参数名称与表单元素的name属性名称一致就会自动填充
[httppost]
public string getdata(string name)
{
return name;
}
3.接收model:表单元素的name属性名称必须与实体对象一样
[httppost]
public string getdata(student model)
{
return model.name;
}
get 接收方式
1.request.querystring:直接通过请求上下文对象里的rquest获取url后的参数