Learn R Programming

rsdmx (version 0.5-0)

SDMXRequestBuilder-class: Class "SDMXRequestBuilder"

Description

A basic class to handle a SDMX service request builder

Usage

SDMXRequestBuilder(baseUrl, suffix, handler)

Arguments

baseUrl
an object of class "character" giving the base Url of the SDMX service endpoint
suffix
an object of class "logical" indicating if the provider agencyId has to be used as suffix in the data web-request, before start/end url parameters
handler
an object of class "function" that will be in charge of build a web request.

Objects from the Class

will be used by the SDMXServiceProvider. This class may be useful for plugging a specific provider (where a specific SDMXRequestBuilder could be implemented. This class allows to provide an request "handler" (typically a function) that performs the SDMX web request build)

Details

The handler function must have the following structure in term of arguments (baseUrl, operation, key, filter, suffix, start, end) and output (a string representing the web request to build). The rsdmx package will as much as possible try to handler generic handlers, e.g. an handler for SDMX REST web-services. For the latter example, a specific builder is provided and made part of the specific and still experimental SDMXRESTRequestBuilder.

Examples

Run this code
#an handler
  myHandler <- function(baseUrl, agencyId, suffix, operation, key, filter, start, end){
    req <- paste(baseUrl, agencyId, operation, key, filter, start, end, sep="/")
    return(req)
  }
  
  #how to create a SDMXRequestBuilder
  requestBuilder <- SDMXRequestBuilder(
                      baseUrl = "http://www.myorg.",
                      suffix = TRUE,
                      handler = myHandler)

Run the code above in your browser using DataLab