summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rest-extras/flickr-proxy-call.c12
-rw-r--r--rest-extras/flickr-proxy.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/rest-extras/flickr-proxy-call.c b/rest-extras/flickr-proxy-call.c
index a9bc6f7..d03f919 100644
--- a/rest-extras/flickr-proxy-call.c
+++ b/rest-extras/flickr-proxy-call.c
@@ -70,13 +70,17 @@ _prepare (RestProxyCall *call, GError **error)
priv = FLICKR_PROXY_GET_PRIVATE (proxy);
call_priv = call->priv;
- /* We need to reset the URL because Flickr puts the function in the parameters */
if (GET_PRIVATE (call)->upload) {
- call_priv->url = g_strdup ("http://api.flickr.com/services/upload/");
+ rest_proxy_bind (REST_PROXY(proxy), "upload");
+ rest_proxy_call_set_function (call, NULL);
} else {
- call_priv->url = g_strdup ("http://api.flickr.com/services/rest/");
- rest_proxy_call_add_param (call, "method", call_priv->function);
+ rest_proxy_bind (REST_PROXY(proxy), "rest");
+ rest_proxy_call_add_param (call, "method",
+ rest_proxy_call_get_function (call));
+ /* We need to reset the function because Flickr puts the function in the
+ * parameters, not in the base URL */
+ rest_proxy_call_set_function (call, NULL);
}
rest_proxy_call_add_param (call, "api_key", priv->api_key);
diff --git a/rest-extras/flickr-proxy.c b/rest-extras/flickr-proxy.c
index 5b7d960..48f1c86 100644
--- a/rest-extras/flickr-proxy.c
+++ b/rest-extras/flickr-proxy.c
@@ -188,8 +188,8 @@ flickr_proxy_new_with_token (const char *api_key,
"api-key", api_key,
"shared-secret", shared_secret,
"token", token,
- "url-format", "http://api.flickr.com/services/rest/",
- "binding-required", FALSE,
+ "url-format", "http://api.flickr.com/services/%s/",
+ "binding-required", TRUE,
NULL);
}