Introduction
************

The WSGI example web service is just about the simplest web service
imaginable. It publishes a collection of key-value pairs.

You can get the root resource.

    >>> from lazr.restful.testing.webservice import WebServiceCaller
    >>> webservice = WebServiceCaller(domain='wsgidemo.dev')
    >>> top_level_response = webservice.get("/")
    >>> top_level_links = top_level_response.jsonBody()
    >>> sorted(top_level_links.keys())
    [u'key_value_pairs_collection_link', u'resource_type_link']

You can get a collection resource.

    >>> collection_resource = webservice.get("/pairs").jsonBody()
    >>> links = sorted([entry['self_link']
    ...                 for entry in collection_resource['entries']])
    >>> for link in links:
    ...     print link
    http://wsgidemo.dev/1.0/1
    http://wsgidemo.dev/1.0/foo

You can get an entry resource.

    >>> entry_resource = webservice.get("/pairs/1").jsonBody()
    >>> sorted(entry_resource.keys())
    [u'http_etag', u'key', u'resource_type_link', u'self_link',
     u'value']

You can get a field resource.

    >>> print webservice.get("/pairs/foo/value").jsonBody()
    bar
