diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-02-25 15:49:58 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-02-25 15:49:58 +0000 |
commit | 048e1f421b84529aa2b29da09027ce997573afd7 (patch) | |
tree | 230bde579a4622d6def27b4961639d3377f9cca3 /plugins/Dropbox/src/api/upload.h | |
parent | 8bf03133314064ec052873b01647c79b69a5b681 (diff) |
Dropbox: reworked files sending
git-svn-id: http://svn.miranda-ng.org/main/trunk@16337 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/api/upload.h')
-rw-r--r-- | plugins/Dropbox/src/api/upload.h | 27 |
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);
}
|