Configure custom response handler for an endpoint
Examples
if (interactive()) {
# Set custom response handler
payload_response_config("/api/process", function(payload, req) {
list(
status = 201L,
body = list(
received = TRUE,
id = paste0("item_", sample(10000:99999, 1)),
timestamp = Sys.time()
)
)
})
# Remove handler (use default response)
payload_response_config("/api/process", NULL)
}
