答案 0 :(得分:0)
对Android帖子使用multipart请求。您可以像这样使用android networking。
AndroidNetworking.upload(url)
.addMultipartFile("image",file)
.addMultipartParameter("data",jsondata.tostring)
.setTag("uploadTest")
.setPriority(Priority.HIGH)
.build()
.setUploadProgressListener(new UploadProgressListener() {
@Override
public void onProgress(long bytesUploaded, long totalBytes) {
// do anything with progress
}
})
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
// do anything with response
}
@Override
public void onError(ANError error) {
// handle error
}
});