Result Formats

Result Formats

RdbHost delivers the results of a query as an XML, JSON or binary page; for most purposes, JSON is the preferred format, as it returns records and fields as structured data. If you prefer xml, that format will provide structured data as well.

If you want your data raw, your fields glued together without any structure, the binary format will provide that.


If the query succeeds, the data will be sent as follows: fields of a record are catenated into record blobs, and record blobs are catenated together into one blob to return. We expect that this will be most useful with queries that return exactly one field.

If the query fails, the error message is plain text, without any structure or markup.


The binary mode is requested with the format parameter. The passed value must start with 'binary', but can also include a content type, like 'format=binary:text/plain', separated by a ':'. If the value includes the content type, the server sends a 'Content-Type' header with that string. Otherwise, the Content-Type is 'application/octet-stream'.

As an alternative, you may provide the format as 'binary', and include another parameter 'contenttype' with the content type; so "format=binary&contenttype=image/gif" is equivalent to "format=binary:image/gif".