post提交不会修改流数据的,你可以把发之前和发之后的数据拿出来自己比较一下,应该是哪个地方处理有问题

解决方案 »

  1.   


    发之前和发之后的byte[]确实不一样。所以才换衣室POST提交造成的啊。
      

  2.   

    我发现在POST前BASE64有+,POST后+变成了空格.
      

  3.   

    不应该吧,我最近的项目就是上传图片的base64编码,post的,一直很正常啊
      

  4.   

    用urlencode吧怎么加?以下是我的POST方法:
    public static String Post(String strUrl, HashMap hmParameter,String htmlCode) throws Exception {
    URL u = null;
    HttpURLConnection con = null;
    String postData = "";
    for (Iterator itr = hmParameter.keySet().iterator(); itr.hasNext();) {
    String key = (String) itr.next();
    String value = (String) hmParameter.get(key);
    if (postData == "") {
    postData = key + "=" + value;
    } else {
    postData += "&" + key + "=" + value;
    }
    }
    try {
    u = new URL(strUrl);

    con = (HttpURLConnection) u.openConnection();
    con.setRequestMethod("POST");
    con.setDoOutput(true);
    con.setDoInput(true);
    con.setConnectTimeout(5 * 1000);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    OutputStreamWriter osw = new OutputStreamWriter(con .getOutputStream(),htmlCode);
    osw.write(postData);
    osw.flush();
    osw.close();
    } catch (Exception e) {
    e.printStackTrace();

    } finally {
    if (con != null) {
    con.disconnect();
    }
    }
    StringBuffer buffer = new StringBuffer();
    try {
    BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String temp;
    while ((temp = br.readLine()) != null) {
    buffer.append(temp);
    buffer.append("\n");
    } } catch (Exception e) {
    e.printStackTrace();
    }
    return buffer.toString();
    }
      

  5.   

    把空格再替换成加号不就行了  http://blog.csdn.net/wang0928007/article/details/7429568
      

  6.   

    有人告诉我是字符集的问题,但是我的JSP,JAVA都是用的UTF-8