Changes between Version 26 and Version 27 of BluePrintREST


Ignore:
Timestamp:
01/04/09 22:53:05 (13 years ago)
Author:
Fran Boon
Comment:

Update for current status

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintREST

    v26 v27  
    22
    33This page hosts detailed specifications for [https://blueprints.launchpad.net/sahana3/+spec/rest Blueprint for the RESTful API].
     4
     5NB This work is mostly done - 'just' need to add support for more representations:
     6 * JSON uploads via POST
     7  * retrieve raw POST data using: {{{request.body.read()}}}
     8   * http://groups.google.com/group/web2py/browse_thread/thread/1418acca8fbc799a
     9   * http://docs.python.org/library/json.html
     10   * http://diveintopython.org/native_data_types/mapping_lists.html
     11  * send POST data using http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype
     12   * jquery.ajax supports username/password: http://docs.jquery.com/Ajax/jQuery.ajax#options
     13   * Cross-domains using JSONP: http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/
     14 * RSS
     15  * {{{import gluon.contrib.rss2 as rss2}}} (see T3/controllers/default.py)
     16 * GeoRSS, KML, GPX, GML, WKT (BluePrintGISImportExport)
     17 * CSV, RTF (native to Web2Py)
     18 * PDF
     19
     20Also can add extra methods to the controller, such as:
     21 * Search (make this the default if many records found?): t2.search()
     22
     23
    424
    525Basic approach for the S3 architecture is to have a Web Services backend & a Javascript client front end.
     
    3353/sahana/gis/feature/id?method=delete
    3454}}}
    35 but T3 requires ID to be the last argument, so don't want URLs like: /id/create
     55but T3 requires ID to be the last argument, so can't do URLs like: /id/create
    3656
    3757These are the benefits:
     
    4767}}}
    4868
    49 We want to extend this to export raw data in other formats, e.g. using the optional vars:
     69This is extended to export raw data in other formats, using the optional vars:
    5070{{{
    5171/sahana/gis/feature/display/id?format=[json|xml|csv]
    5272}}}
    53 or another arg:
     73which was considered better than using another arg:
    5474{{{
    5575/sahana/gis/feature/display/[json|xml|csv]/id
    5676}}}
    57 
    58 Web2Py already supports export as JSON, CSV & RTF.
    59  * New SQLROW to JSON function: http://groups.google.com/group/web2py/browse_thread/thread/dfb65087574c24f1
    60  * For XML Parser discussions, look at [wiki:BluePrintGISImportExport BluePrintGISImportExport]
    61 
    62 It would be best for us to add support to the framework to make it easy for module writers to have this functionality within their controllers.
    6377
    6478NB Web2Py currently doesn't support HTTP PUT/DELETE/UPDATE (only GET).[[BR]]
     
    90104 * http://mail.python.org/pipermail/python-list/2003-September/223257.html
    91105 * http://www.rexx.com/~dkuhlman/rest_howto.html
    92  * FeatureServer: http://featureserver.org/
    93  * WebProcessingServer: http://code.google.com/p/webprocessingserver/
     106 * !FeatureServer: http://featureserver.org/
     107 * !WebProcessingServer: http://code.google.com/p/webprocessingserver/
    94108 * Tarawa framework: http://www.mnot.net/tarawa/tutorial.html
    95109 * Rest in Python framework: http://lukearno.com/projects/rip/