问题就是题目,如何解决?急急急,谢谢各位

解决方案 »

  1.   

    问题就是code=400,参数正确,为什么会是400呢?
      

  2.   

    可以贴出 你的  调用接口的代码以及接口代码;比如  jsp代码,和  controller中的接口代码
      

  3.   

    这是接口中的参数@RequestParam("classRecordId") Integer classRecordId, @RequestBody JSONObject jsonObject
    调用的代码:private ReturnResult endClass(Integer classId, List<Integer> studentIdList) {
            Map<String, Object> params = new HashMap<>(3);
            params.put("classRecordId", classId);
            params.put("jsonObject", studentIdList);
            JSONObject jsonObject = new JSONObject(params);
            String jsonStr = JSON.toJSONString(jsonObject);
            System.out.println(jsonStr);
            HttpRequestEntity httpRequestEntity = new HttpRequestEntity.Builder().withUrl(endClassUrl).withPost(true).withPostData(jsonStr).build();
            try {
                Response response = OkHttpUtils.getInstance().httpPostJsonRequest(httpRequestEntity);
                System.out.println(response.isSuccessful());
            } catch (IOException e) {
                e.printStackTrace();
            }
      

  4.   

    看这个请求参数格式的话@RequestParam("classRecordId") Integer classRecordId, @RequestBody JSONObject jsonObject
    可以这样试一下
    将classRecordId参数拼接到访问路径,不要放到params中
    endClassUrl  拼接参数   endClassUrl += "?classRecordId=" + classRecordId;
      

  5.   

    域名+api接口+方法接口(endClassUrl += "?classRecordId=" + classRecordId)
    http://xxxxxx" + /api +/endClassUrl += "?classRecordId=" + classRecordId
    还是404
      

  6.   

    url拼接错了