librest is a library was designed to make it easier to access web services that claim to be "RESTful".

Future Plans

Support multiple values for parameters

Some web services support this, resulting in URLs of the form Internally we could implement this by either storing the parameters in a GData structure (easier for the libsoup integration as we can use soup_form_encode_datalist()) or in a hash of string key->list of string values (nicer but we'll have to encode manually).

We should probably change rest_proxy_call_get_params() to return a custom iterator type (like GHashTableIter) for users who want to iterate the params (e.g. Flickr signature generation), instead of exposing the internal implementation.

Form Encoding

Currently the parameters are encoded as application/x-www-form-urlencoded. For use-cases such as uploading images to Flickr, we need to be able to encode as multipart/form-data. SoupMultipart will probably be useful here. Convenience API to set a parameter from a file would be useful here, so that the user doesn't have to read a file to memory and then copy it into librest.


Currently the only way to set a username/password is to manually add it to the URL when creating the proxy. This isn't great and we need to expose this in a useful way. Simply wrapping the libsoup API (SoupMessage::authenticate signal) may well be the best solution.

Cleaner API

Rob wants to make the API "like Cairo".

Redesign OAuth API

The API design is getting ugly and needs work.

Annoyingly we can't move the bulk of the code to a SoupAuth subclass because hitting an OAuth endpoint without credentials doesn't result in HTTP 401, but some arbitrary code (Yahoo returns 400 Bad Request, and custom XMl stating that the consumer key is missing).

Other things that are important:

  • Implement the Error Reporting spec
  • Pass arguments returned back the access_token call back to the callee

GIO-style calls

The RestProxyCall API should be redesigned to be like GIO.

Binding Tool

How about a basic IDL which lets you describe a web service and it generates type-safe wrappers?

Projects/Librest (last edited 2013-11-22 18:34:08 by WilliamJonMcCann)