Hi all, I am trying to submit a multipart form from an Android app to a Stripes 
action. I have a SecurityFilter in place and I can trap/log the request. I see 
the request coming in but I do not see any of the form fields that I have 
added. I am using the library OkHttpClient to make the request. Here is what I 
think are the important bits


String requestURL = 
"https://www.venturefarther.com/upload/HandleDirectNMEAUpload.action";;

MediaType MEDIA_TYPE_ZIP = MediaType.parse("application/zip");
OkHttpClient preconfiguredClient = new OkHttpClient();

OkHttpClient client = trustAllSslClient(preconfiguredClient);

RequestBody requestBody = new MultipartBody.Builder()
        .setType(MultipartBody.FORM)
        .addFormDataPart("key", "userkey")
        .addFormDataPart("attachment", zipFile.getName(),
                RequestBody.create(MEDIA_TYPE_ZIP, zipFile))
        .build();

Request request = new Request.Builder()
        .header("User-Agent", "VentureFarther")
        .url(requestURL)
        .post(requestBody)
        .build();

Response response = null;
try {
    response = client.newCall(request).execute();
    Log.i(TAG,response.body().string());
} catch (IOException e) {
    e.printStackTrace();
}

Any thoughts?


Jon
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to