AddFileEx and Protocol Hints

Registered by Maia Everett

Steadyflow 0.1.x is completely protocol-agnostic - a nice feature of GIO. But for Steadyflow 0.2, we'll need to use another backend instead of GIO for HTTP. This will presumably be libsoup (bug #996121).

To pass HTTP headers from external applications (such as browser extensions), we will need a generic way to add them to the command line and DBus API. I'm thinking of calling this "protocol hints". A protocol hint is defined as a key-value pair, where the key is the protocol name ("http" for HTTP headers), followed by the hint name (for HTTP, this is the header itself).

So the syntax to add an HTTP Referer header from the command line will be:

steadyflow add -hint:http:Referer=http://example.com http://server/file.ext

For D-Bus, a new AddFileEx call will be added to the API, alongside the existing AddFile. The Vala signature for the call will be:

int add_file_ex(string url, string? target_file_name, bool silent, GLib.HashTable<string, string> protocol_hints);

where "silent" specifies whether Steadyflow should prompt the user to add the file, or just silently start the download. (I'm not sure about this option - at the very least, Steadyflow should prompt to confirm overwrite or resume!)

There is intentionally no interface to specify what to do on completion. I intend to add a D-Bus signal to let clients receive notifications for download completion, and execute whatever actions they want to execute themselves.

We will probably need to add at least one specific HTTP protocol hint that aren't headers: POST data, which, if supplied, will make Steadyflow use POST instead of GET, with the supplied input.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.