Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在Android中使用WLResourceRequest创建多部分请求_Java_Android_Multipartform Data_Ibm Mobilefirst_Mobilefirst Adapters - Fatal编程技术网

Java 如何在Android中使用WLResourceRequest创建多部分请求

Java 如何在Android中使用WLResourceRequest创建多部分请求,java,android,multipartform-data,ibm-mobilefirst,mobilefirst-adapters,Java,Android,Multipartform Data,Ibm Mobilefirst,Mobilefirst Adapters,我创建了一个Java适配器,它接受多部分表单数据。现在我想从我的原生Android应用程序创建一个多部分请求。但我不知道如何在MobileFirstAPI中使用WLResourceRequest类构造多部分请求。任何在这个方向上的例子或指针都将不胜感激。 提前谢谢 您不必通过客户端中的WLResourceRequest执行此操作 在我看来,你应该做的事情与此类似: // Create the request to send final HttpPost post = new HttpPost("

我创建了一个Java适配器,它接受多部分表单数据。现在我想从我的原生Android应用程序创建一个多部分请求。但我不知道如何在MobileFirstAPI中使用WLResourceRequest类构造多部分请求。任何在这个方向上的例子或指针都将不胜感激。
提前谢谢

您不必通过客户端中的WLResourceRequest执行此操作

在我看来,你应该做的事情与此类似:

// 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):

谢谢,它现在可以工作了!但出于某种奇怪的原因,身份验证API使用了ApacheHttpClient,这在Android中是不受欢迎的。所以我必须使用Android的URLConnection编写这些API及其逻辑(使用反编译的WLAuthorizationManager类)。但是,感谢您提供了如何处理安全性的指针。弃用并不意味着删除,只是暂时删除。我们意识到Android的变化,并将致力于解决这些变化。