What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Mar 09, 2008 by peter.fein
RestUrls  
Description of REST URL schema

This page describes the URL schema for the RestFrontend. Operation refers to the Collection method.

Single Document

URL HTTP method Operation Description Parameters
http://example.com/ GET list returns list of all ids
http://example.com/abc GET retrieve retrieve single result with id='abc' fields
http://example.com/abc DELETE delete delete single document with id='abc'
http://example.com/abc PUT create store single document with id='abc'
http://example.com/__append__/ GET get a HTML form for creating a single document
http://example.com/__append__/ POST create store a single document with server-provided id

Several Documents

URL HTTP method Operation Description Parameters
http://example.com/__id__/abc,xyz GET retrieve retrieve several results with ids {'abc', 'xyz'} fields
http://example.com/__id__/abc,xyz DELETE delete delete several documents with ids {'abc', 'xyz'}
http://example.com/__extend__/ POST create store several documents

Queries

URL HTTP method Operation Description Parameters
http://example.com/__query__/ GET get a list of available queries
http://example.com/__query__/foo GET fooQuery run the backend-specific fooQuery per backend, maps to function args

Parameters

Additional Parameters are URL query parameters. For example: http://example.com/pants/?fields=size,color

fields

Applies to: retrieve, __query__

A list of fields to return in the results. If not present, return all available fields. &fields= is a , separated list of strings.

XXX We should use +, see issue 72.

format

Applies to: all

An alternative means of [http://en.wikipedia.org/wiki/Content_negotiation content negotation]. Instead of using the Accept and Content-Type headers, clients may specify &format=. If a header and parameter are present, the query parameter takes precedence.

This parameter is useful for debugging.

Browser Support

Most webbrowers only support the GET and POST methods. To accomodate these clients, the RestFrontend will rewrite requests with the with the method query parameter.


Sign in to add a comment