• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

build/H17-Oct-2017-25,71420,621

docs/H03-May-2022-3,0372,568

examples/H03-May-2022-1,7531,248

rest/H03-May-2022-12,4658,895

rest-extras/H03-May-2022-4,1633,124

tests/H03-May-2022-2,5461,935

AUTHORSH A D08-Sep-201470 32

COPYINGH A D08-Sep-201425.9 KiB511422

INSTALLH A D08-Sep-20149.3 KiB238179

Makefile.amH A D08-Sep-2014746 3725

Makefile.inH A D03-May-202229.8 KiB941836

READMEH A D08-Sep-20142.3 KiB5041

aclocal.m4H A D17-Oct-201753.8 KiB1,5041,356

config.h.inH A D17-Oct-20171.6 KiB6543

configureH A D17-Oct-2017467.8 KiB15,91813,353

configure.acH A D17-Oct-20174.1 KiB151122

gtk-doc.makeH A D19-Jul-20179.7 KiB300254

rest-extras.pc.inH A D08-Sep-2014312 1311

rest.pc.inH A D08-Sep-2014305 1311

README

1librest
2=======
3
4This library has been designed to make it easier to access web services that
5claim to be "RESTful". A reasonable definition of what this means can be found
6on Wikipedia [1]. However a reasonable description is that a RESTful service
7should have urls that represent remote objects which methods can then be
8called on.
9
10However it should be noted that the majority of services don't actually adhere
11to this strict definition. Instead their RESTful end-point usually has an API
12that is just simpler to use compared to other types of APIs they may support
13(XML-RPC, for instance.). It is this kind of API that this library is
14attempting to support.
15
16It comprises of two parts: the first aims to make it easier to make requests
17by providing a wrapper around libsoup [2], the second aids with XML parsing by
18wrapping libxml2 [3].
19
20Making requests
21~~~~~~~~~~~~~~~
22
23When a proxy is created for a url you are able to present a format string.
24This format string is intended to represent the type of path for a remote
25object, it is then possible to bind this format string with specific names of
26objects to make this proxy concrete rather than abstract. We abstract the
27parameters required for a particular call into it's own object which we can
28then invoke both asynchronously and pseudo-asynchronously (by spinning the
29main loop whilst waiting for an answer.) This has the advantage of allowing us
30to support complex behaviour that depends on the parameters, for instance
31signing a request: a requirement for many web services.
32
33Handling the result
34~~~~~~~~~~~~~~~~~~~
35
36Standard XML parsers require a significant amount of work to parse a piece of
37XML. In terms of a SAX parser this involves setting up the functions before
38hand, in terms of a DOM parser this means dealing with complexity of a DOM
39tree. The XML parsing components of librest are designed to try and behave a
40bit like the BeautifulSoup parser [4]. It does this by parsing the XML into an
41easily walkable tree were nodes have children for their descendents and
42siblings for the nodes of the same type that share the same parent. This makes
43it easy for instance to get a list of all the "photo" nodes in a document from
44the root.
45
46[1] - http://en.wikipedia.org/wiki/Representational_State_Transfer
47[2] - http://live.gnome.org/LibSoup
48[3] - http://xmlsoft.org/
49[4] - http://www.crummy.com/software/BeautifulSoup/
50