简体   繁体   English

BasicNetwork.performRequest:意外的响应代码500

[英]BasicNetwork.performRequest: Unexpected response code 500

I am using volley for POST method to server. 我正在使用凌空服务器的POST方法。 I am sending two parametars and I am getting this Unexpected response code 500. 我发送了两个参数,并且得到了这个意外响应代码500。

Here is JsonObjectReguest code: 这是JsonObjectReguest代码:

final String URL 最终的字符串URL

            JsonObjectRequest req = new JsonObjectRequest(Request.Method.POST,URL, null,
                    new Response.Listener<JSONObject>() {
                        @Override
                        public void onResponse(JSONObject response) {
                            try {
                                VolleyLog.v("Response:%n %s", response.toString(4));
                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                        }
                    }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    VolleyLog.e("Error: ", error.getMessage());
                }
            }){
                protected HashMap<String, String> getParams() {
                    HashMap<String, String> params = new HashMap<String, String>();
                    params.put("cid", String.valueOf(id));
                    params.put("positions", string);

                    return params;
                }
                @Override
                public HashMap<String, String> getHeaders() throws AuthFailureError {
                    HashMap<String,String> headers = new HashMap<String, String>();
                    headers.put("Content-Type","application/x-www-form-urlencoded");
                    return headers;
                }
            };


            AppController.getInstance().addToRequestQueue(req);
        }

Here is my logcat: 这是我的日志:

04-08 02:44:05.110 32385-32511/com.example.bukic.postexample I/System.out﹕ propertyValue:true 04-08 02:44:05.114 32385-32511/com.example.bukic.postexample I/System.out﹕ [socket][3] connection maps.b1.finki.ukim.mk/194.149.138.7:80;LocalPort=45144(2500) 04-08 02:44:05.115 32385-32511/com.example.bukic.postexample I/System.out﹕ [CDS]connect[maps.b1.finki.ukim.mk/194.149.138.7:80] tm:2 04-08 02:44:05.116 32385-32511/com.example.bukic.postexample D/Posix﹕ [Posix_connect Debug]Process com.example.bukic.postexample :80 04-08 02:44:05.189 32385-32511/com.example.bukic.postexample I/System.out﹕ [socket][/192.168.1.100:45144] connected 04-08 02:44:05.189 32385-32511/com.example.bukic.postexample I/System.out﹕ [CDS]rx timeout:2500 04-08 02:44:05.302 32385-32511/com.example.bukic.postexample I/System.out﹕ Shutdown rx/tx 04-08 02:44:05.303 32385-32511/com.example.bukic.postexample I/System.out﹕ [CDS]close[45144] 04-08 02:44:05.304 32385-32511/com.example.bukic.postexample I/System. 04-08 02:44:05.110 32385-32511 / com.example.bukic.postexample I / System.out属性值:true 04-08 02:44:05.114 32385-32511 / com.example.bukic.postexample I / System .out:[socket] [3]连接maps.b1.finki.ukim.mk/194.149.138.7:80;LocalPort=45144(2500)04-08 02:44:05.115 32385-32511 / com.example.bukic。 postexample I / System.out:[CDS] connect [maps.b1.finki.ukim.mk/194.149.138.7:80] tm:2 04-08 02:44:05.116 32385-32511 / com.example.bukic.postexample D / Posix:[Posix_connect调试]处理com.example.bukic.postexample:80 04-08 02:44:05.189 32385-32511 / com.example.bukic.postexample I / System.out:[socket] [/ 192.168。 1.100:45144]已连接04-08 02:44:05.189 32385-32511 / com.example.bukic.postexample I / System.out:[CDS] rx超时:2500 04-08 02:44:05.302 32385-32511 / com .example.bukic.postexample I / System.out:关闭rx / tx 04-08 02:44:05.303 32385-32511 / com.example.bukic.postexample I / System.out:[CDS] close [45144] 04- 08 02:44:05.304 32385-32511 / com.example.bukic.postexample I /系统。 out﹕ Shutdown rx/tx 04-08 02:44:05.305 32385-32511/com.example.bukic.postexample I/System.out﹕ Shutdown rx/tx 04-08 02:44:05.307 32385-32511/com.example.bukic.postexample I/System.out﹕ close [socket][/0.0.0.0:45144] 04-08 02:44:05.309 32385-32511/com.example.bukic.postexample E/Volley﹕ [3280] BasicNetwork.performRequest: Unexpected response code 500 for http://maps.b1.finki.ukim.mk/MapController/save 04-08 02:44:05.313 32385-32385/com.example.bukic.postexample E/Volley﹕ 1 2.onErrorResponse: Error: out:关闭rx / tx 04-08 02:44:05.305 32385-32511 / com.example.bukic.postexample I / System.out:关闭rx / tx 04-08 02:44:05.307 32385-32511 / com.example .bukic.postexample I / System.out:关闭[套接字] [/ 0.0.0.0:45144] 04-08 02:44:05.309 32385-32511 / com.example.bukic.postexample E / Volley:[3280] BasicNetwork。 performRequest:对于意外的响应码500 http://maps.b1.finki.ukim.mk/MapController/save 44:05.313 32385-32385 / com.example.bukic.postexample E /排球:2月4日至8日1 2。 onErrorResponse:错误:

![One of params is cid ][1] ![参数之一是cid ] [1]

[1]: http://i.stack.imgur.com/lY1R5.jpg one of params is cid [1]: http : //i.stack.imgur.com/lY1R5.jpg参数之一是cid

![One of params is cId ][1] ![参数之一是cId ] [1]

[1]: http://i.stack.imgur.com/B0AHG.jpg one of params is cId instead of cid [1]: http ://i.stack.imgur.com/B0AHG.jpg参数之一是cId而不是cid

I recommend you a extension of chrome named Postman . 我建议您将Chrome扩展名为Postman We can send http request and verify the result by using it and it is very useful. 我们可以发送http请求并使用它来验证结果,它非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 E / Volley:[126] BasicNetwork.performRequest:意外的响应代码500 - E/Volley: [126] BasicNetwork.performRequest: Unexpected response code 500 BasicNetwork.performRequest:意外的响应代码500 Android - BasicNetwork.performRequest: Unexpected response code 500 Android BasicNetwork.performRequest:意外的响应代码413? - BasicNetwork.performRequest: Unexpected response code 413? BasicNetwork.performRequest:意外的响应代码422 - BasicNetwork.performRequest: Unexpected response code 422 BasicNetwork.performRequest:意外的响应代码400(GET) - BasicNetwork.performRequest: Unexpected response code 400 (GET) Volley - BasicNetwork.performRequest:意外的响应代码400 POST - Volley - BasicNetwork.performRequest: Unexpected response code 400 POST Volley BasicNetwork.performRequest:意外的响应代码 301 - Volley BasicNetwork.performRequest: Unexpected response code 301 Android Volley:BasicNetwork.performRequest:意外的响应代码404 - Android Volley: BasicNetwork.performRequest: Unexpected response code 404 E / Volley:[145] BasicNetwork.performRequest:https://的意外响应代码404 - E/Volley: [145] BasicNetwork.performRequest: Unexpected response code 404 for https:// 如何修复“Volley:[15771] BasicNetwork.performRequest:Android 中的意外响应代码 404? - How to fix "Volley: [15771] BasicNetwork.performRequest: Unexpected response code 404 in android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM