summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dropbox/src/api')
-rw-r--r--plugins/Dropbox/src/api/upload.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/Dropbox/src/api/upload.h b/plugins/Dropbox/src/api/upload.h
index e612046ba6..7e1c501297 100644
--- a/plugins/Dropbox/src/api/upload.h
+++ b/plugins/Dropbox/src/api/upload.h
@@ -10,11 +10,12 @@ public:
AddBearerAuthHeader(token);
AddHeader("Content-Type", "application/octet-stream");
- JSONNode root(JSON_NODE);
- root << JSONNode("path", path);
+ JSONNode params(JSON_NODE);
+ params
+ << JSONNode("path", path)
+ << JSONNode("mode", "overwrite");
- json_string params = root.write();
- AddHeader("Dropbox-API-Arg", params.c_str());
+ AddHeader("Dropbox-API-Arg", params.write().c_str());
SetData(data, size);
}
@@ -42,13 +43,12 @@ public:
AddBearerAuthHeader(token);
AddHeader("Content-Type", "application/octet-stream");
- JSONNode root(JSON_NODE);
- root
+ JSONNode params(JSON_NODE);
+ params
<< JSONNode("session_id", sessionId)
<< JSONNode("offset", (unsigned long)offset);
- json_string params = root.write();
- AddHeader("Dropbox-API-Arg", params.c_str());
+ AddHeader("Dropbox-API-Arg", params.write().c_str());
SetData(data, size);
}
@@ -71,15 +71,16 @@ public:
JSONNode commit(JSON_NODE);
commit.set_name("commit");
- commit << JSONNode("path", path);
+ commit
+ << JSONNode("path", path)
+ << JSONNode("mode", "overwrite");
- JSONNode root(JSON_NODE);
- root
+ JSONNode params(JSON_NODE);
+ params
<< cursor
<< commit;
- json_string params = root.write();
- AddHeader("Dropbox-API-Arg", params.c_str());
+ AddHeader("Dropbox-API-Arg", params.write().c_str());
SetData(data, size);
}