Java MultiPart发布到C#端

时间:2016-02-03 05:06:07

标签: java c# android multipartentity

我将使用以下 Android Java 代码将图像上传到C#服务器API:

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(FILE_UPLOAD_URL);
AndroidMultiPartEntity entity = new AndroidMultiPartEntity();

File sourceFile = new File(filePath);

// Adding file data to http body
entity.addPart("image", new FileBody(sourceFile));
     
totalSize = entity.getContentLength();
httppost.setEntity(entity);
     
// Making server call
HttpResponse response = httpclient.execute(httppost);
HttpEntity r_entity = response.getEntity();

从C#端API到接收此图像的等效代码是什么?

0 个答案:

没有答案