Changes between Version 2 and Version 3 of DeveloperGuidelines/Tutorial/RESTCustomisation
- Timestamp:
- 06/11/10 21:10:19 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/Tutorial/RESTCustomisation
v2 v3 1 == REST Customisation Mini Tutorial == 1 [[TOC]] 2 = S3REST Customisation Mini Tutorials = 3 4 see also: [wiki:RESTController RESTController], [wiki:S3REST S3REST] 5 6 == REST and CRUD == 2 7 3 8 It seems generally difficult for new developers to understand how to take control of functionality in the [wiki:RESTController] of the S3 framework. … … 89 94 A very important structure during prep and postp is the S3RESTRequest object (usually instantiated as "jr"). This object contains all necessary 90 95 information 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 == 91 98 92 99 Let me give you another recipe: … … 226 233 NOTE: representation in jr is always all lowercase, there is no differentiation between the ".XML" and ".xml" extension in the URL. 227 234 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) 235 And...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).