Calling Web Services via Curl

From FMR Knowledge Base
Revision as of 05:50, 7 February 2023 by Plazarou (talk | contribs) (Use of Curl)
Jump to navigation Jump to search

Rather than using the Graphical User Interface, the Fusion Metadata Registry can perform operations by calling its Web Services. Examples of these are the Data Validation and Data Transformation Web Services. These can be invoked by a tool such as Postman, but this page aims to give some guidance on using the UNIX tool "curl" to invoke these Web Services.

Use of Curl

An example showing a call to transform an SDMX-CSV input file "My Input File.csv" into SDMX-ML version 2.1. The output is redirected into the output file "Generated.xml"

  curl -X POST 
    --header "Content-Type:application/text" 
    --header "Structure:urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=OECD:DF_BATIS_EBOPS2010(1.0)" 
    --data-binary "@My Input File.csv" 
    --header "Accept: application/vnd.sdmx.structurespecificdata+xml;version=2.1" 
    http://localhost:8080/FusionRegistry/ws/public/data/transform 
    > Generated.xml