cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject android commit: [CB-51] Added httpMethod for upload (defaults to POST)
Date Wed, 27 Mar 2013 18:29:56 GMT
Updated Branches:
  refs/heads/master f4859444d -> 5ee7e81ff


[CB-51] Added httpMethod for upload (defaults to POST)


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/5ee7e81f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/5ee7e81f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/5ee7e81f

Branch: refs/heads/master
Commit: 5ee7e81ff96476a3784ab2db9fab10574b4b95e7
Parents: f485944
Author: JasonM23 <jasonm23@gmail.com>
Authored: Fri Mar 22 11:56:43 2013 +1100
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Mar 27 14:22:41 2013 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/FileTransfer.java |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/5ee7e81f/framework/src/org/apache/cordova/FileTransfer.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/FileTransfer.java b/framework/src/org/apache/cordova/FileTransfer.java
index dba29af..75bed2c 100644
--- a/framework/src/org/apache/cordova/FileTransfer.java
+++ b/framework/src/org/apache/cordova/FileTransfer.java
@@ -204,6 +204,7 @@ public class FileTransfer extends CordovaPlugin {
         // Look for headers on the params map for backwards compatibility with older Cordova
versions.
         final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers")
: args.optJSONObject(8);
         final String objectId = args.getString(9);
+        final String httpMethod = getArgument(args, 10, "POST");
 
         Log.d(LOG_TAG, "fileKey: " + fileKey);
         Log.d(LOG_TAG, "fileName: " + fileName);
@@ -213,6 +214,7 @@ public class FileTransfer extends CordovaPlugin {
         Log.d(LOG_TAG, "chunkedMode: " + chunkedMode);
         Log.d(LOG_TAG, "headers: " + headers);
         Log.d(LOG_TAG, "objectId: " + objectId);
+        Log.d(LOG_TAG, "httpMethod: " + httpMethod);
         
         final URL url;
         try {
@@ -280,7 +282,7 @@ public class FileTransfer extends CordovaPlugin {
                     conn.setUseCaches(false);
 
                     // Use a post method.
-                    conn.setRequestMethod("POST");
+                    conn.setRequestMethod(httpMethod);
                     conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="
+ BOUNDARY);
 
                     // Set the cookies on the response


Mime
View raw message