porcelain_returning | R Documentation |
Support for describing and controlling expected return types. The
high-level functions (porcelain_returning_json
and
porcelain_returning_binary
) should be generally used.
porcelain_returning(content_type, process, validate, status_code = 200L)
porcelain_returning_json(schema = NULL, root = NULL, status_code = 200L)
porcelain_returning_binary(status_code = 200L)
porcelain_returning_text(status_code = 200L)
content_type |
The MIME content type for the endpoint,
e.g. |
process |
A processing function that will convert the output
of the handler function into something of the type
|
validate |
A function that validates the return value and
throws an error if the output is not expected. This will only
be used if the endpoint is created with |
status_code |
The HTTP status code that the endpoint will use on a successful return. The default of 200 should be reasonable. |
schema |
The name of the json schema to use |
root |
The root of the schema directory. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.