Route: Route class

RouteR Documentation

Route class

Description

This class represents assigning an R function to an http request path

Public fields

path

Is a string that sets the http request path.

handler

Is the Route function handler which optionally accepts a Request argument.

content_type

Is the MIME content type returned by the function. Common MIME types are listed here. The default MIME type is "text/plain".

Methods

Public methods


Method new()

Create a Route object

Usage
Route$new(path = NULL, handler = NULL, content_type = "text/plain")
Arguments
path

http request path.

handler

A callback function that executes when the path request is received.

content_type

A string that defines the MIME type of the content returned by handler.

Returns

A new 'Route' object


Method clone()

The objects of this class are cloneable with this method.

Usage
Route$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Rick Dean

Examples

Route$new(path="/flight_column_names", handler = getColumnNames, content_type = "text/plain")


deandevl/RserverPkg documentation built on June 9, 2022, 9:44 p.m.