Good afternoon, tell me I'm trying to send json for this I use this construction
JSONObject jsonObject = new JSONObject(); jsonObject.put("name", "foo"); jsonObject.put("num", new Integer(100)); jsonObject.put("balance", new Double(1000.21)); jsonObject.put("is_vip", new Boolean(true)); StringWriter out = new StringWriter(); jsonObject.writeJSONString(out); HttpClient client = new DefaultHttpClient(); HttpPost http = new HttpPost(url); List nameValuePairs = new ArrayList(1); nameValuePairs.add(new BasicNameValuePair("type", out.toString())); http.setEntity(new UrlEncodedFormEntity(nameValuePairs)); String response = (String) client.execute(http, new BasicResponseHandler()); System.out.println(response); but the server writes
{"error":{"id":3,"text":"no param name, no param num, no param balance, no param is_vip"}} what is the reason ?