try(http_error())
try(http_error(400))
try(http_error(400, "Sorry"))
str(http_success())
str(http_success(201))
str(http_success(201, "Awesome"))
str(http_response(201, "Awesome", list(name = "Jane", count = 6)))
req <- new.env()
res <- new.env()
str(http_handler(req, res, 201, "Awesome", list(name = "Jane", count = 6)))
res$status
str(res$body)
Run the code above in your browser using DataLab