Changes between Version 26 and Version 27 of BluePrintREST
- Timestamp:
- 01/04/09 22:53:05 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrintREST
v26 v27 2 2 3 3 This page hosts detailed specifications for [https://blueprints.launchpad.net/sahana3/+spec/rest Blueprint for the RESTful API]. 4 5 NB 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 20 Also can add extra methods to the controller, such as: 21 * Search (make this the default if many records found?): t2.search() 22 23 4 24 5 25 Basic approach for the S3 architecture is to have a Web Services backend & a Javascript client front end. … … 33 53 /sahana/gis/feature/id?method=delete 34 54 }}} 35 but T3 requires ID to be the last argument, so don't wantURLs like: /id/create55 but T3 requires ID to be the last argument, so can't do URLs like: /id/create 36 56 37 57 These are the benefits: … … 47 67 }}} 48 68 49 We want to extend this to export raw data in other formats, e.g.using the optional vars:69 This is extended to export raw data in other formats, using the optional vars: 50 70 {{{ 51 71 /sahana/gis/feature/display/id?format=[json|xml|csv] 52 72 }}} 53 oranother arg:73 which was considered better than using another arg: 54 74 {{{ 55 75 /sahana/gis/feature/display/[json|xml|csv]/id 56 76 }}} 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/dfb65087574c24f160 * 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.63 77 64 78 NB Web2Py currently doesn't support HTTP PUT/DELETE/UPDATE (only GET).[[BR]] … … 90 104 * http://mail.python.org/pipermail/python-list/2003-September/223257.html 91 105 * 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/ 94 108 * Tarawa framework: http://www.mnot.net/tarawa/tutorial.html 95 109 * Rest in Python framework: http://lukearno.com/projects/rip/