Android 安卓截击获得意外响应代码500

Android 安卓截击获得意外响应代码500,android,android-volley,Android,Android Volley,我有一个简单的链接作为GET,用于从windows server上实现的服务器检索数据,我的android应用程序必须能够从该服务器获取数据,响应为json格式,例如,当我在FireFox地址栏上使用此链接时: http://MY_SITE/android/main.aspx?page=1&cat=0 我得到的JsonArray响应如下: [{"ID":27,"Number":"03331514800","Price":1500000,"Date":"","Status":0,"Cat

我有一个简单的链接作为
GET
,用于从windows server上实现的服务器检索数据,我的android应用程序必须能够从该服务器获取数据,响应为
json
格式,例如,当我在
FireFox
地址栏上使用此链接时:

http://MY_SITE/android/main.aspx?page=1&cat=0
我得到的
JsonArray
响应如下:

[{"ID":27,"Number":"03331514800","Price":1500000,"Date":"","Status":0,"Cat":"$1$4$8$8$9$23$","SalesName":null,"TransID":null,"SalesDate":null,"SalesTime":null,"SalesSuccess":false}]
这是正确的,但是当我使用
Volley
库时,我得到了这个错误
意外响应代码500

我的代码:

private void getLatestSimCardNumbers() {
    fetch_server_url = Application.getHostAddress() + "http://MY_SITE/android/main.aspx";

    HashMap<String, String> jsonBody = new HashMap<>();

    jsonBody.put("page", "1");
    jsonBody.put("cat", "0");

    HttpsTrustManager.allowAllSSL();
    JsonArrayRequest req = new JsonArrayRequest(fetch_server_url, new JSONObject(jsonBody),
            new Response.Listener<JSONArray>() {
                @Override
                public void onResponse(JSONArray response) {
                    Log.e("RESPONSE", response.toString());
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            Log.e("ERR ", "");
        }
    });
    int         socketTimeout = 30000;
    RetryPolicy policy        = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
    req.setRetryPolicy(policy);
    Application.getInstance().addToRequestQueue(req);
}
private void getLatestSimCardNumbers(){
fetch_server_url=Application.getHostAddress()+”http://MY_SITE/android/main.aspx";
HashMap jsonBody=新HashMap();
jsonBody.put(“第1页”);
jsonBody.put(“cat”,“0”);
HttpsTrustManager.allowAllSSL();
JsonArrayRequest req=新JsonArrayRequest(获取服务器url,新JSONObject(jsonBody)),
新的Response.Listener(){
@凌驾
公共void onResponse(JSONArray响应){
Log.e(“RESPONSE”,RESPONSE.toString());
}
},new Response.ErrorListener(){
@凌驾
公共无效onErrorResponse(截击错误){
Log.e(“ERR”,“ERR”);
}
});
int socketTimeout=30000;
RetryPolicy policy=新的DefaultRetryPolicy(socketTimeout,DefaultRetryPolicy.DEFAULT\u MAX\u RETRIES,DefaultRetryPolicy.DEFAULT\u BACKOFF\u MULT);
请求设置策略(策略);
Application.getInstance().addToRequestQueue(req);
}

您的URL在浏览器中不工作,因此我认为它在服务器端有问题。@MayurPatel我的URL在firefox上工作正常,没有任何问题,先生,它在firefox和chrome上不工作。它检查了一下,然后你读了这篇文章链接:@MayurPatel当我在firefox地址栏上粘贴并发送请求后得到结果时,我得到了JSON格式的响应,我将其粘贴到了我的帖子上,你认为它有问题吗?500表示服务器端出错。在截击的内部类中调试以获得准确的错误