我知道这是重复的问题,但我不能解决这个问题,我试图张贴与截取请求,但我得到服务器错误的回应,下面是我的代码
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正常为空
为什么我在stringrequest中得到“null”。在logcat中,我得到了e/volley:[17510]basicnetwork.performrequest:的意外响应代码500http://si.sudlife.in/salesillustration/forms/sudleap.aspx
我想我在发布请求时犯了一些错误,请帮我解决这个问题。
暂无答案!
目前还没有任何答案,快来回答吧!