Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/394.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java BasicNetwork.performRequest:意外响应代码500_Java_Android - Fatal编程技术网

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

Java BasicNetwork.performRequest:意外响应代码500,java,android,Java,Android,我正在使用截击的POST方法发送到服务器。我正在发送两个参数,我得到了这个意外的响应代码500 以下是JsonObjectReguest代码: 这是我的日志: 04-08 02:44:05.110 32385-32511/com.example.bukic.postexample I/System.out﹕ 属性值:真04-08 02:44:05.114 32385-32511/com.example.bukic.postexample I/System.out﹕ [现场][3] 联系 地图b1

我正在使用截击的POST方法发送到服务器。我正在发送两个参数,我得到了这个意外的响应代码500

以下是JsonObjectReguest代码:

这是我的日志:

04-08 02:44:05.110 32385-32511/com.example.bukic.postexample I/System.out﹕ 属性值:真04-08 02:44:05.114 32385-32511/com.example.bukic.postexample I/System.out﹕ [现场][3] 联系 地图b1.finki.ukim.mk/194.149.138.7:80;本地端口=451442500 04-08 02:44:05.115 32385-32511/com.example.bukic.postexample I/System.out﹕ [CDS]连接[maps.b1.finki.ukim.mk/194.149.138.7:80]tm:204-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﹕ [插座][/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﹕ 关机接收/发送 04-08 02:44:05.303 32385-32511/com.example.bukic.postexample I/System.out﹕ [CDS]关闭[45144]04-0802:44:05.304 32385-32511/com.example.bukic.postexample I/System.out﹕ 关机接收/发送 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 04-08 02:44:05.313 32385-32385/com.example.bukic.postexample E/Volley﹕ 2.1错误响应:错误:

!![其中一个参数为cid][1]

[1] :其中一个参数是cid

!![其中一个参数为cId][1]

[1] :其中一个参数是cId而不是cId


我向您推荐一个名为Postman的chrome扩展。我们可以发送http请求并使用它验证结果,这非常有用。

500表示服务器中存在内部错误。检查你的网络和http头和正文。嗯…我在我的代码中更改了cld中的cid并运行应用程序,但我仍然得到这个基本网络。性能要求。。。
            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);
        }