request.POST.get()在django中给出None

时间:2016-06-30 09:03:15

标签: python ajax django python-requests

我有一个ajax调用,我使用pdb捕获了请求。 request.POST 为我提供以下值:

 protected void checkOuput(object sender, EventArgs e)
{
    string data = "";
    foreach (GridViewRow row in GrdRole.Rows)
    {
        if (row.RowType == DataControlRowType.DataRow)
        {
            CheckBox chkRow = (row.Cells[0].FindControl("chkCtrl") as CheckBox);
            if (chkRow.Checked)
            {
                string EmployeeNo = row.Cells[2].Text;
                data = data + EmployeeNo + " ,  " ;
            }
        }
    }
    ClientScript.RegisterStartupScript(GetType(), "alert", "alert('" + data + "');", true);
}

request.POST.get('status')提供

1 个答案:

答案 0 :(得分:2)

您没有发送表单编码数据,因此request.POST无用。使用request.body