Skip to contents

The get_request is function that makes HTTP GET requests to STAC web services, retrieves, and parse the data.

The post_request is function that makes HTTP POST requests to STAC web services, retrieves, and parse the data.

Usage

get_request(q, ...)

post_request(q, ..., encode = c("json", "multipart", "form"))

Arguments

q

a RSTACQuery object expressing a STAC query criteria.

...

config parameters to be passed to GET or POST methods, such as add_headers or set_cookies.

encode

a character informing the request body Content-Type. Accepted types are 'json' ('application/json'), 'form' ('application/x-www-form-urlencoded'), and 'multipart' ('multipart/form-data'). Defaults to 'json'.

Value

Either a STACCatalog, STACCollection, STACCollectionList, STACItemCollection or STACItem

object depending on the subclass and search fields parameters of q

argument.

Examples

if (FALSE) {
 stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
  get_request()

 stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
  stac_search(collections = "CB4_64_16D_STK-1") %>%
  post_request()
}