response.js

Summary
response.js
bbop.rest.responseGeneric BBOP handler for dealing with the gross parsing of responses from a REST server.
Functions
responseContructor for a REST query response object.
rawReturns the initial response object, whatever it was.
okaySimple return verification of sane response from server.
messageA message that the response wants to let you know about its creation.
message_typeA message about the message (a string classifier) that the response wants to let you know about its message.

bbop.rest.response

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).

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.

Summary
Functions
responseContructor for a REST query response object.
rawReturns the initial response object, whatever it was.
okaySimple return verification of sane response from server.
messageA message that the response wants to let you know about its creation.
message_typeA message about the message (a string classifier) that the response wants to let you know about its message.

Functions

response

bbop.rest.response = function(in_data)

Contructor for a REST query response object.

The constructor argument is an object, not a string.

Arguments

in_datathe string returned from a request

Returns

rest response object

raw

bbop.rest.response.prototype.raw = function()

Returns the initial response object, whatever it was.

Arguments

n/a

Returns

object

okay

bbop.rest.response.prototype.okay = function(okay_p)

Simple return verification of sane response from server.

This okay() caches its return value, so harder probes don’t need to be performed more than once.

Arguments

okay_p[optional] setter for okay

Returns

boolean

message

bbop.rest.response.prototype.message = function(message)

A message that the response wants to let you know about its creation.

Arguments

message[optional] setter for message

Returns

message string

message_type

bbop.rest.response.prototype.message_type = function(message_type)

A message about the message (a string classifier) that the response wants to let you know about its message.

Arguments

message_type[optional] setter for message_type

Returns

message type string

bbop.rest.response = function(in_data)
Contructor for a REST query response object.
bbop.rest.response.prototype.raw = function()
Returns the initial response object, whatever it was.
bbop.rest.response.prototype.okay = function(okay_p)
Simple return verification of sane response from server.
bbop.rest.response.prototype.message = function(message)
A message that the response wants to let you know about its creation.
bbop.rest.response.prototype.message_type = function(message_type)
A message about the message (a string classifier) that the response wants to let you know about its message.
Close