Difference between revisions of "Calling Web Services via Curl"

From FMR Knowledge Base
Jump to navigation Jump to search
(Use of Curl)
Line 2: Line 2:
  
 
== Use of Curl ==
 
== 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"
  
 
<pre>
 
<pre>
Line 7: Line 9:
 
   --header "Content-Type:application/text"  
 
   --header "Content-Type:application/text"  
 
   --header "Structure:urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=OECD:DF_BATIS_EBOPS2010(1.0)"  
 
   --header "Structure:urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=OECD:DF_BATIS_EBOPS2010(1.0)"  
   --data-binary "@BATIS_EBOPS2010_UPDATE_OWNER_TOPMETA_DIM1_DIM2_DIM6 2022-12-13 10~05~49_processed.csv"  
+
   --data-binary "@My Input File.csv"  
 
   --header "Accept: application/vnd.sdmx.structurespecificdata+xml;version=2.1"  
 
   --header "Accept: application/vnd.sdmx.structurespecificdata+xml;version=2.1"  
 
   http://localhost:8080/FusionRegistry/ws/public/data/transform  
 
   http://localhost:8080/FusionRegistry/ws/public/data/transform  
 
     > Generated.xml
 
     > Generated.xml
 
</pre>
 
</pre>

Revision as of 06:50, 7 February 2023

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