|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| build/ | H | 17-Oct-2017 | - | 25,714 | 20,621 |
| docs/ | H | 03-May-2022 | - | 3,037 | 2,568 |
| examples/ | H | 03-May-2022 | - | 1,753 | 1,248 |
| rest/ | H | 03-May-2022 | - | 12,465 | 8,895 |
| rest-extras/ | H | 03-May-2022 | - | 4,163 | 3,124 |
| tests/ | H | 03-May-2022 | - | 2,546 | 1,935 |
| AUTHORS | H A D | 08-Sep-2014 | 70 | 3 | 2 |
| COPYING | H A D | 08-Sep-2014 | 25.9 KiB | 511 | 422 |
| INSTALL | H A D | 08-Sep-2014 | 9.3 KiB | 238 | 179 |
| Makefile.am | H A D | 08-Sep-2014 | 746 | 37 | 25 |
| Makefile.in | H A D | 03-May-2022 | 29.8 KiB | 941 | 836 |
| README | H A D | 08-Sep-2014 | 2.3 KiB | 50 | 41 |
| aclocal.m4 | H A D | 17-Oct-2017 | 53.8 KiB | 1,504 | 1,356 |
| config.h.in | H A D | 17-Oct-2017 | 1.6 KiB | 65 | 43 |
| configure | H A D | 17-Oct-2017 | 467.8 KiB | 15,918 | 13,353 |
| configure.ac | H A D | 17-Oct-2017 | 4.1 KiB | 151 | 122 |
| gtk-doc.make | H A D | 19-Jul-2017 | 9.7 KiB | 300 | 254 |
| rest-extras.pc.in | H A D | 08-Sep-2014 | 312 | 13 | 11 |
| rest.pc.in | H A D | 08-Sep-2014 | 305 | 13 | 11 |
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