[Stable]

tsc_POST(
  data,
  serializer,
  query = list(format = "json"),
  encode = "json",
  api_url = get_tsc_api_url(),
  api_token = get_tsc_api_token(),
  verbose = get_tsc_verbose()
)

Arguments

data

(JSON) A list of lists (JSON) to post to TSC.

serializer

(character) TSC API serializer name (required) Possible values see https://tsc.dbca.wa.gov.au/api/1/

query

(list) A list of POST parameters, default: list(format="json").

encode

The parameter encode for \link{httr::POST}, default: "json". Other options: c("multipart", "form", "json", "raw").

api_url

(character) The TSC API URL, default get_tsc_api_url, see tsc_setup

api_token

(character) The TSC API token, default get_tsc_api_token, see tsc_setup

verbose

Whether to show verbose messages. Default: get_tsc_verbose.

Value

An S3 object of class 'tsc_api_response' containing: data: The parsed response content serializer: The called serializer, e.g. 'supra' url: The called URL date: The timestamp of the request status_code: The HTTP status code of the request

Examples

if (FALSE) {
# One by one
gj <- "public:herbie_hbvnames_public" %>% kmi_getFeature()
props <- purrr::map(gj[["features"]], "properties")
tsc_POST(props[[1]], serializer = "names")

# All in batch
"public:herbie_hbvnames_public" %>%
  gs_getWFS() %>%
  upsert_geojson(serializer = "names", verbose = T)
}