summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/api
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-02-27 16:03:20 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-02-27 16:03:20 +0000
commitce1317d110f70eee0d835ffa3c761168e2f5e9b7 (patch)
treeea290bde0b8761edd76cbdd00393d17586299bae /plugins/Dropbox/src/api
parent2814cd2a0f6ed89dab0c4dca6b8dbb2c7523bef9 (diff)
Drobpox:
- added search command - fixed other commands git-svn-id: http://svn.miranda-ng.org/main/trunk@16363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/api')
-rw-r--r--plugins/Dropbox/src/api/operations.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/plugins/Dropbox/src/api/operations.h b/plugins/Dropbox/src/api/operations.h
index 71c455d1e8..cdd35223e4 100644
--- a/plugins/Dropbox/src/api/operations.h
+++ b/plugins/Dropbox/src/api/operations.h
@@ -21,6 +21,26 @@ public:
}
};
+class SearchRequest : public HttpRequest
+{
+public:
+ SearchRequest(const char *token, const char *query) :
+ HttpRequest(REQUEST_POST, DROPBOX_API_RPC "/files/search")
+ {
+ AddBearerAuthHeader(token);
+ AddHeader("Content-Type", "application/json");
+
+ JSONNode params(JSON_NODE);
+ params
+ << JSONNode("path", "")
+ << JSONNode("query", query)
+ << JSONNode("max_results", 10);
+
+ json_string data = params.write();
+ SetData(data.c_str(), data.length());
+ }
+};
+
class DeleteRequest : public HttpRequest
{
public:
@@ -82,7 +102,7 @@ public:
AddHeader("Content-Type", "application/json");
JSONNode root(JSON_NODE);
- root << JSONNode("path", path);
+ root << JSONNode("path", "");
json_string data = root.write();
SetData(data.c_str(), data.length());