我有以下带有base64图像内容的JSON字符串。你能帮助我,我怎么能张贴此JSON作为多部分:Android使用POST方法向服务器传递JSON数据
{
"TakeoffID": "2",
"address": ",nexhex",
"city": "Xrk Zed",
"state": "AZ",
"date": "12/08/2015",
"ViewNote": "",
"ViewPhoto1": "base64ImageContent",
"ViewPhoto2": "base64ImageContent",
"ViewPhoto3": "base64ImageContent",
"TakeoffDoneBy": "Jxehx",
"AcctName": "Gsgve",
"LoginUserID": "46669",
"jobId": "whshs",
"LineItems": [
{
"OrderLineid": "544",
"OrderLineTypeid": "Post Light",
"OrderLineQty": "2",
"OrderLinePhoto1": "base64ImageContent",
"OrderLinePhoto2": "base64ImageContent",
"OrderLinePhoto3": "base64ImageContent",
"OrderLineNotes": "",
"OrderLineLocation": "Post Lights"
}
]
}
由于它是Base64编码图像,您不应该只发送一个普通的'application/json'请求吗?去[OkHttp食谱](https://github.com/square/okhttp/wiki/Recipes)。它拥有你所需要的一切。 –
确实。将json作为多部分发送是没有意义的。 – greenapps
@Ravi,你有没有试过下面的答案,它工作吗? – Hits