API: Return Values

Character Encoding

SubSift return values are encoded as UTF-8.

JSON Callback Wrappers (JSONP)

For security reasons it is common practice to wrap JSON data returned from a server in a JavaScript function name supplied by the client. This technique is known as JSONP. The SubSift REST API supports this by allowing any method call to include the callback request parameter with any legal JavaScript function name as its value. The request parameter jsoncallback may be used as an equivalent alternative to callback.

JSON is normally served by SubSift with the mime type of applications/json but for JSONP the mime type application/javascript is used, as is conventional under JSONP.

Suppressing HTTP Status Error Codes

Some Flash and JavaScript applications running in browsers intercept all non-200 HTTP status responses, never returning the response value to the client program. This is incompatible with REST and AJAX in general. To work around this problem, the SubSift REST API allows any method call to include the suppress_response_codes request parameter with any non-null value. This forces SubSift to always return the HTTP response status '200 OK'.