summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/api/operations.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-05-13 20:12:06 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-05-13 20:12:06 +0000
commitf8830ba4d8827a9460de51e17ccd8caeed7217e2 (patch)
treec1c15b0590c89eff2644b1618982860634c497df /plugins/Dropbox/src/api/operations.h
parent5865e7f3b1013d8540e8bd5a8a012da26d6f6768 (diff)
Dropbox: some fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@13577 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/api/operations.h')
-rw-r--r--plugins/Dropbox/src/api/operations.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/Dropbox/src/api/operations.h b/plugins/Dropbox/src/api/operations.h
index 56578515b3..b94d90b4e7 100644
--- a/plugins/Dropbox/src/api/operations.h
+++ b/plugins/Dropbox/src/api/operations.h
@@ -4,8 +4,8 @@
class ShareRequest : public HttpRequest
{
public:
- ShareRequest(const char *token, const char *path, bool useShortUrl = true) :
- HttpRequest(REQUEST_POST, FORMAT, DROPBOX_API_URL "/shares/auto/%s", path)
+ ShareRequest(const char *token, const char *path, bool useShortUrl = true, const char *root = "auto") :
+ HttpRequest(REQUEST_POST, FORMAT, DROPBOX_API_URL "/shares/%s/%s", root, path)
{
if (!useShortUrl)
AddUrlParameter("short_url=false");
@@ -18,13 +18,13 @@ public:
class DeleteRequest : public HttpRequest
{
public:
- DeleteRequest(const char *token, const char *path) :
+ DeleteRequest(const char *token, const char *path, const char *root = "auto") :
HttpRequest(REQUEST_POST, DROPBOX_API_URL "/fileops/delete")
{
AddBearerAuthHeader(token);
AddHeader("Content-Type", "application/x-www-form-urlencoded");
- CMStringA data(CMStringDataFormat::FORMAT, "root=auto&path=%s", path);
+ CMStringA data(CMStringDataFormat::FORMAT, "root=%s&path=%s", root, path);
data.Replace('\\', '/');
SetData(data.GetBuffer(), data.GetLength());
}
@@ -33,13 +33,13 @@ public:
class CreateFolderRequest : public HttpRequest
{
public:
- CreateFolderRequest(const char *token, const char *path) :
+ CreateFolderRequest(const char *token, const char *path, const char *root = "auto") :
HttpRequest(REQUEST_POST, DROPBOX_API_URL "/fileops/create_folder")
{
AddBearerAuthHeader(token);
AddHeader("Content-Type", "application/x-www-form-urlencoded");
- CMStringA data(CMStringDataFormat::FORMAT, "root=auto&path=%s", path);
+ CMStringA data(CMStringDataFormat::FORMAT, "root=%s&path=%s", root, path);
data.Replace('\\', '/');
SetData(data.GetBuffer(), data.GetLength());
}
@@ -48,8 +48,8 @@ public:
class GetMetadataRequest : public HttpRequest
{
public:
- GetMetadataRequest(const char *token, const char *path) :
- HttpRequest(REQUEST_GET, FORMAT, DROPBOX_API_URL "/metadata/auto/%s", path)
+ GetMetadataRequest(const char *token, const char *path, const char *root = "auto") :
+ HttpRequest(REQUEST_GET, FORMAT, DROPBOX_API_URL "/metadata/%s/%s", root, path)
{
AddBearerAuthHeader(token);
}