The reference to os:HttpRequest was that both an "HTTP Status
Code" (an integer), and a text message are available. Shindig tries to
make both available. The OpenSocial article, and as far as I can tell
osapi.http only has the text message. Because these are to be an HTTP
request, the actual "HTTP Status Code" has value.
So I propose the following wording for section "5.2.2.3.5 The callback
parameter". BTW - I'm not very familiar with OAuth, and simply copied
the text for those parameters, but they might need some work as well.
The makeRequest() callback function is passed a javascript object with
the following fields:
"rc"
This will contain the HTTP Status Code (
http://www.w3.org/
Protocols/rfc2616/rfc2616-sec10.html) for the request. This field will
always be present.
"errors"
This will contain an array of any errors that occurred when making
this request. For example, if a 500 error occurred in the request:
[ "500 error" ]. If rc is 200, this field if present must be a zero
length array. If rc is not 200, this field must be present, and
contain at least one element.
"text"
This will return the unparsed text of the response.
"data"
This will contain a different type of data depending on the type
of request that was made, and is only present if rc is 200. This is
controlled by the parameter gadgets.io.RequestParameters.CONTENT_TYPE,
with values enumerated in gadgets.io.ContentType.
There may be several additional OAuth-specific fields:
"oauthApprovalUrl"
If this value is specified, the user needs to visit an external
page to approve the gadget's request to access data. Use of a pop-up
window to direct the user to the external page is recommended. Once
the user has approved access, the gadget can repeat the makeRequest
call to retrieve the data.
"oauthError"
If this value is specified, it indicates an OAuth-related error
occurred. The value will be one of a set of string constants that can
be used for programmatically detecting errors. The constants are
undefined for opensocial-0.8, but implementers should attempt to agree
on a set of useful constant values for standardization in
opensocial-0.9.
"oauthErrorText"
If this value is specified, it indicates an OAuth-related error
occurred. The value is free-form text that can be used to provide
debugging information for gadget developers.
On Sep 15, 5:53 pm, Adam Winer <
awi...@gmail.com> wrote: