GeoNetwork REST API Manager Utils
GeoNetwork REST API Manager Utils
Format
R6Class object.
Value
Object of R6Class with static util methods for communication
with the REST API of a GeoNetwork instance.
Static methods
getUserAgent()This method is used to get the user agent for performing GeoNetwork API requests. Here the user agent will be compound by geonapi package name and version.
getUserToken(user, pwd)This method is used to get the user authentication token for performing GeoNetwork API requests. Token is given a Base64 encoded string.
GET(url, path, token, verbose)This method performs a GET request for a given
pathto GeoNetwork REST APIPUT(url, path, token, filename, contentType, verbose)This method performs a PUT request for a given
pathto GeoNetwork REST API, to upload a file of namefilenamewith givencontentTypePOST(url, path, token, content, contentType, encode, verbose)This method performs a POST request for a given
pathto GeoNetwork REST API, to post content of givencontentTypeDELETE(url, path, token, verbose)This method performs a DELETE request for a given GeoNetwork resource identified by a
pathin GeoNetwork REST APIparseResponseXML(req)Convenience method to parse XML response from GeoNetwork REST API. Although package httr suggests the use of xml2 package for handling XML, geonapi still relies on the package XML. Response from httr is retrieved as text, and then parsed as XML 'xmlParse' function.
getPayloadXML(obj)Convenience method to create payload XML to send to GeoNetwork.