IDE-hints: request and reponse placeholders for IDE hints

Description Usage Format See Also Examples

Description

request and reponse placeholders for IDE hints

Usage

1
2
3

Format

An object of class Request (inherits from R6) of length 28.

An object of class Response (inherits from R6) of length 26.

See Also

Request Response

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(RestRserve)

app = Application$new()

app$add_get("/foo", FUN = function(.req, .res) {
  # since .res is a dummy instance of Response class
  # exported by RestRserve
  # IDE facilitates with autocompletion!
  .res$set_body("bar")
  # in the same time all the modifications happen with local objects
  # so you get right results in the end
})

response = app$process_request(Request$new(path = "/foo"))
response$body

RestRserve documentation built on Jan. 13, 2021, 7:05 p.m.