开发者

android http post base 64 string to .net wcf

开发者 https://www.devze.com 2023-03-29 08:04 出处:网络
This is urgent. I am trying to post an image convert to base 64 string. This is my Android (java) code.

This is urgent. I am trying to post an image convert to base 64 string. This is my Android (java) code.

private String decodeUTF8(byte[] bytes) {
    return Base64.encodeToString(bytes,0);
}
   String json = "{\"Image\":\""+img+"\",\"Locationxy\": \"" + location
                +"\", \"PestInfo\": \"" + pestInfoTxt.getText().toString() + "\", \"UserID\":\"" 
                + user + "\" } " ;

At server, error: There was an error deserializing the obje开发者_开发知识库ct of type Pest. Encountered invalid character ' '.

How to encode?


try passing in the NO_WRAP flag to the Base64 encoder. the JSON deserializer might be choking on unescaped newlines within the string.

0

精彩评论

暂无评论...
验证码 换一张
取 消