Description Usage Arguments Examples
Simple S3 class to denote JSON responses for httupv.
1 2 | microserver_response(response = NULL, status = 200,
headers = list(`content-type` = "text/json"))
|
response |
ANY. The R object to send as a response parameter. If the header is set to text/json it will be converted into a JSON string. |
status |
integer. HTTP status (default is |
headers |
list. A list of HTTP headers (default is
|
1 2 3 4 5 | ## Not run:
response('Did not work!', 404) # 404 error
response(list(a = 1, b = 2)) # { "a": 1, "b": 2 } JSON response
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.