Changes between Version 2 and Version 3 of DeveloperGuidelines/Tutorial/RESTCustomisation


Ignore:
Timestamp:
06/11/10 21:10:19 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Tutorial/RESTCustomisation

    v2 v3  
    1 == REST Customisation Mini Tutorial ==
     1[[TOC]]
     2= S3REST Customisation Mini Tutorials =
     3
     4see also: [wiki:RESTController RESTController], [wiki:S3REST S3REST]
     5
     6== REST and CRUD ==
    27
    38It seems generally difficult for new developers to understand how to take control of functionality in the [wiki:RESTController] of the S3 framework.
     
    8994A very important structure during prep and postp is the S3RESTRequest object (usually instantiated as "jr"). This object contains all necessary
    9095information to process the current REST request, and it is passed to both prep and postp. See [wiki:S3REST#S3RESTRequest] for a list of attributes and methods.
     96
     97== Custom methods ==
    9198
    9299Let me give you another recipe:
     
    226233NOTE: representation in jr is always all lowercase, there is no differentiation between the ".XML" and ".xml" extension in the URL.
    227234
    228 And...not to forget:
    229 
    230 Your warehouse_report is still a controller function, that means you can implement forms as usual (e.g. operated with form.accepts).
    231 
    232 To distinguish between different HTTP methods (in case you need that), you can use:
    233 
    234 http_method = jr.http # gives one of "GET", "POST", "PUT" or "DELETE"
    235 
    236 (...whatever PUT or DELETE would mean for a warehouse report, you would probably just ignore these)
     235And...not to forget: your warehouse_report is still a controller function, that means you can implement forms as usual (e.g. operated with form.accepts or web2py Crud).