Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

httpDELETE

DELETE-binding middleware


Description

Routes HTTP DELETE requests to the specified path with the specified callback functions or middleware.

Usage

httpDELETE(beakr, path = NULL, FUN = NULL)

Arguments

beakr

Beakr instance or NULL.

path

String representing a path for which the middleware function is invoked.

FUN

Middleware function to be invoked.

Value

A Beakr instance with added middleware.

Examples

## Not run: 
library(beakr)

# Create an new Beakr instance
beakr <- newBeakr()

# Create a simple beakr pipeline
beakr %>%
  httpDELETE("/", function(req, res, err) {
    return("Successful DELETE request!\n")
  }) %>%
  listen(host = '127.0.0.1', port = 25118, daemon = TRUE)

# ------------------------------------------------------------
# IN A TERMINAL:
#  curl -X DELETE http://127.0.0.1:25118/
# > Successful DELETE request!
# ------------------------------------------------------------

# Stop the beakr instance server
stopServer(beakr)

## End(Not run)

beakr

A Minimalist Web Framework for R

v0.4.3
GPL-3
Authors
Hans Martin [aut], Jonathan Callahan [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.