简体   繁体   中英

How to create a Multipart request using WLResourceRequest in Android

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!

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

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);

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM