Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CC00FB88 for ; Wed, 27 Mar 2013 18:29:57 +0000 (UTC) Received: (qmail 3916 invoked by uid 500); 27 Mar 2013 18:29:56 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 3882 invoked by uid 500); 27 Mar 2013 18:29:56 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 3874 invoked by uid 99); 27 Mar 2013 18:29:56 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Mar 2013 18:29:56 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A79028281D0; Wed, 27 Mar 2013 18:29:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: android commit: [CB-51] Added httpMethod for upload (defaults to POST) Date: Wed, 27 Mar 2013 18:29:56 +0000 (UTC) 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 Authored: Fri Mar 22 11:56:43 2013 +1100 Committer: Andrew Grieve 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