mock_tableau_request: Create a mock JSON request that mimics the request structure...

Description Usage Arguments Details Value Examples

View source: R/mock_tableau_request.R

Description

mock_tableau_request() creates a JSON object formatted like a request from Tableau. The JSON object it returns can be pasted directly into the "Try it out" field in the Swagger documentation for an endpoint to test its functionality.

Usage

1

Arguments

script

String indicating the path to the endpoint to be called

data

A list or dataframe that is serialized to JSON

...

Additional arguments passed to jsonlite::toJSON()

Details

Behind the scenes, Tableau sends all requests to the /evaluate endpoint. Each request is a JSON object containing two items: script and data. plumbertableau uses script to specify an individual endpoint to call, and passes the arguments in data on to the function at that endpoint.

Value

A JSON object that can be passed to a Tableau endpoint

Examples

1
mock_tableau_request("/loess/predict", mtcars[,c("hp", "mpg")])

plumbertableau documentation built on Aug. 6, 2021, 9:05 a.m.