我知道这是重复的问题,但我无法解决问题,我试图用凌空发布请求,但我收到服务器错误响应,下面是我的代码
public void sendrequest()
{
final String ctl00$txtGivenName = "vinita";
final String ctl00$txtSurname = "kumawat";
final String ctl00$txtDate = "11/09/1991";
final String ctl00$ddlGender = "Female";
final String ctl00$txtAge = "25";
final String ctl00$txtMobile = "1234567890";
final String ctl00$txtEmailID= "v0xyz@xyz.com";
final String ctl00$ddlState = "28";
final String ctl00$ddlCity="16";
final String ctl00$ddlBranchList="10";
final String ctl00$txtAddress="xyz";
final String ctl00$ddlChannel="1";
final String ctl00$ddlPrdCode = "SUDLEAP";
final String ctl00$ContentPlaceHolder1$ddlPremiumPayingTerm = "5";
final String ctl00$ContentPlaceHolder1$ddlMode="1";
final String ctl00$ContentPlaceHolder1$ddlADTPDRider="1";
final String ctl00$ContentPlaceHolder1$txtPayoutPeriod = "5";
final String ctl00$ContentPlaceHolder1$txtDefermentPeriod = "5";
final String ctl00$ContentPlaceHolder1$ddlStandardAgeProof = "1";
final String ctl00$ContentPlaceHolder1$txtRiderSumAssured ="500000";
final String ctl00$ContentPlaceHolder1$ddlFIBRider = "2";
final String __VIEWSTATE =viewstateIn;
StringRequest stringRequest = new StringRequest(Request.Method.POST, "http://si.sudlife.in/SalesIllustration/Forms/SUDLEAP.aspx",
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(NeedTable.this,response,Toast.LENGTH_LONG).show();
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(NeedTable.this,error.toString(),Toast.LENGTH_LONG).show();
}
}){
@Override
protected Map<String,String> getParams()throws com.android.volley.AuthFailureError {
Map<String,String> params = new HashMap<String, String>();
params.put(KEY_name,ctl00$txtGivenName);
params.put(KEY_surname,ctl00$txtSurname );
params.put(KEY_dob,ctl00$txtDate );
params.put(KEY_gender,ctl00$ddlGender );
params.put(KEY_age,ctl00$txtAge );
params.put(KEY_mobile,ctl00$txtMobile );
params.put(KEY_email,ctl00$txtEmailID );
params.put(KEY_state,ctl00$ddlState );
params.put(KEY_city,ctl00$ddlCity );
params.put(KEY_branch,ctl00$ddlBranchList );
params.put(KEY_address,ctl00$txtAddress );
params.put(KEY_channel,ctl00$ddlChannel);
params.put(KEY_prdcode,ctl00$ddlPrdCode );
params.put(KEY_ppt,ctl00$ContentPlaceHolder1$ddlPremiumPayingTerm );
params.put(KEY_mode,ctl00$ContentPlaceHolder1$ddlMode);
params.put(KEY_adtpdrider,ctl00$ContentPlaceHolder1$ddlADTPDRider);
params.put(KEY_payputperiod,ctl00$ContentPlaceHolder1$txtPayoutPeriod );
params.put(KEY_dperiod,ctl00$ContentPlaceHolder1$txtDefermentPeriod );
params.put(KEY_ageproof,ctl00$ContentPlaceHolder1$ddlStandardAgeProof );
params.put(KEY_sumassured,ctl00$ContentPlaceHolder1$txtRiderSumAssured );
params.put(KEY_fibrider,ctl00$ContentPlaceHolder1$ddlFIBRider );
params.put(KEY_VIEWSTATE,NeedTable.viewstateIn);
return params;
}
};
Log.i("stringRequest","stringRequest"+stringRequest);
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
}
我收到服务器错误响应。 Log.i( “stringRequest”, “stringRequest” + stringRequest); 给I / stringRequest:stringRequest [] http://si.sudlife.in/SalesIllustration/Forms/SUDLEAP.aspx 0x2c24cb6d NORMAL null
为什么我在stringRequest中获得“null”。 在logcat中,我得到了E / Volley:[17510] BasicNetwork.performRequest:http://si.sudlife.in/SalesIllustration/Forms/SUDLEAP.aspx的意外响应代码500
我认为我在发布请求时遇到了一些错误,请帮我解决这个问题。