如何创建Android中使用WLResourceRequest multipart请求时 [英] How to create a Multipart request using WLResourceRequest in Android

查看:437
本文介绍了如何创建Android中使用WLResourceRequest multipart请求时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个Java适配器,它接受多重表单数据。现在我想创建从我的家乡Android应用multipart请求。但我无法弄清楚如何构建使用WLResourceRequest类MobileFirst API multipart请求。在这个方向的任何例子或指针将大大AP preciated。
在此先感谢!

I've created a Java adapter which accepts Multipart Form data. Now I want to create a multipart request from my native Android App. But I'm not able to figure out how to construct a multipart request using WLResourceRequest class in MobileFirst API. Any example or pointer in this direction will be greatly appreciated. Thanks in advance!

推荐答案

您不必通过WLResourceRequest在客户端做到这一点。

You needn't do this via WLResourceRequest in the client-side.

IMO你应该做的是类似这样的:

IMO what you should do is something similar to this:

// Create the request to send
final HttpPost post = new HttpPost("your-destination");

// Construct the body of the object...
...
...

// Send the request and get the response
HttpResponse response = client.execute(post);

如果您有涉及安全性,您可能需要阅读下列文件以及(POST想象,而不是GET):<一href=\"http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.dev.doc/dev/c_custom_request_to_resource_java.html?lang=en\" rel=\"nofollow\">http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.dev.doc/dev/c_custom_request_to_resource_java.html?lang=en

If you have security involved, you may want to read the following documentation as well (think POST instead of GET): http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.dev.doc/dev/c_custom_request_to_resource_java.html?lang=en

这篇关于如何创建Android中使用WLResourceRequest multipart请求时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆