解决方案 »

  1.   

    发送json参数,首先你的构造这样的json字符串,你这明显不是json格式的字符串嘛
      

  2.   


    我已经得到了Json参数,这里只是一个例子而已,我想要问的是如何发送
      

  3.   

            List<NameValuePair> nvps = new ArrayList<NameValuePair>();
            nvps.add(new BasicNameValuePair(name, userName));  
            nvps.add(new BasicNameValuePair(pass, password));
            httpost.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));
      

  4.   


    我需要的不是这种形式,我已经解决了,Thanks,我把它当做字符串发送就行了
      

  5.   

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    StringEntity myEntity = new StringEntity("<commond><code>"+clientVo.getCode()+"</code><data>"+clientVo.getData()+"</data></commond>", "UTF-8");
    httppost.setEntity(myEntity);
    HttpResponse response = httpclient.execute(httppost);
      

  6.   

    楼主这个问题怎么解决的?如何使用httpClient发送一个字符串?望指点!