[shotwell/wip/flickr-description: 4/5] tumblr: Let soup do the form work



commit 33d5319d46d6644e84490e5aff041f6c9a85082d
Author: Jens Georg <mail jensge org>
Date:   Thu Mar 12 20:16:29 2020 +0100

    tumblr: Let soup do the form work

 plugins/shotwell-publishing/TumblrPublishing.vala | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/plugins/shotwell-publishing/TumblrPublishing.vala 
b/plugins/shotwell-publishing/TumblrPublishing.vala
index bee958d2..bd065ca3 100644
--- a/plugins/shotwell-publishing/TumblrPublishing.vala
+++ b/plugins/shotwell-publishing/TumblrPublishing.vala
@@ -606,13 +606,13 @@ namespace Publishing.Tumblr {
 
                 this.authorize();
 
-                Publishing.RESTSupport.Argument[] request_arguments = get_arguments();
-                assert(request_arguments.length > 0);
-
-                var request_data = Publishing.RESTSupport.Argument.serialize_list(request_arguments, true, 
false, "&");
+                var form = new GLib.HashTable<string, string>(GLib.str_hash, GLib.str_equal);
+                foreach (var arg in get_arguments()) {
+                    form.insert(arg.key, arg.value);
+                }
+                assert(form.size() > 0);
 
-                Soup.Message outbound_message = new Soup.Message( "POST", get_endpoint_url());
-                outbound_message.set_request("application/x-www-form-urlencoded", Soup.MemoryUse.COPY, 
request_data.data);
+                var outbound_message = Soup.Form.request_new_from_hash ("POST", get_endpoint_url(), form);
 
                 // TODO: there must be a better way to iterate over a map
                 Gee.MapIterator<string, string> i = base.message_headers.map_iterator();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]