开发者

send Image byte data in json request in android?

开发者 https://www.devze.com 2023-04-09 07:08 出处:网络
I would like to send image byte data in Http Post in android and iPhone. Let me know hoe to send Image data in JSON Like below JSON String

I would like to send image byte data in Http Post in android and iPhone.

Let me know hoe to send Image data in JSON Like below JSON String

 {
 "Request": {
    "data": {
    "Key": "keydata",
    "info": {},
    "param": {
        "title": "Testingpostmultipartimageupload",
        "photo": **"IMAGE BYTE DATA"**,
        "photoFilenam开发者_运维技巧e": "Test.png"
    }
},
"info": {}
}

Thanks in advance,


ByteArrayOutputStream ba = new ByteArrayOutputStream();
    imageBitmap.compress(Bitmap.CompressFormat.PNG, 100, ba); 
    byte[] bmpbyte_sign = ba.toByteArray();

pass bmpbyte_sign. Hope will help u...


Dude just convert the image into the bytes then decode with this data with base64 string and pass that string in the json. BTW I'm from iPhone

0

精彩评论

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