Description Usage Arguments Details Examples
When building a web server or API it is often useful to send more complex
data obects. Within prairie one can do this by converting the object to JSON.
Additionally, prairie exposes the generic as.json
function allowing
users to specify how their custom classes need to be converted to JSON.
1 2 3 4 5 6 7 8 9 |
x |
Any R object. |
... |
Additional arguments to pass on to |
For the included as.json
functions, the excellent package
jsonlite
does all the heavy lifting behind the scenes. This package is
straightforward to use and is recommended for those who wish to create
further as.json
functions.
Setting a response object body as an object with class json will automatically set the response object's Content-Type to application/json.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.