modulebbop-rest-response
Source: response.
This module contains two response handlers.
First, a generic BBOP handler for dealing with the gross parsing of responses from a REST server. This is just an example pass-thru handler that needs to be overridden (see subclasses).
Second, a generic BBOP handler for dealing with the gross parsing of responses from a REST JSON server. It will detect if the incoming response is a string, and if so, try to parse it to JSON. Otherwise, if the raw return is already an Object, we assume that somebody got to it before us (e.g. jQuery's handling).
A little more discussion of the base class.
You may note that things like status and status codes are not part of the base response. The reason is is that not all methods of REST in the environments that we use support them. For example: readURL in rhino. For this reason, the "health" of the response is left to the simple okay() function--just enought to be able to choose between "success" and "failure" in the managers. To give a bit more information in case of early error, there is message and message_type.
Similarly, there are no toeholds in the returned data except raw(). All data views and operations are implemented in the subclasses.
This module includes the following objects:
- base: essentially uninteresting base class
- json: json parsing attmpted