Tips for consumers

sosna edited this page Nov 28, 2014 · 7 revisions

Connect to the service via https

So, you want to keep a local database up to date with data from your favourite data providers? Or maybe, you just want to build a few visualisations with data coming from various web services? Great, that's what SDMX web services are all about! But are you sure it's a good idea to do so without first checking the identity of the data providers? If not, then make sure you connect to the web service via https.

Know your mime type

If you don't specify the format you want (using the HTTP Accept header), the web service is expected to return the more recent version (e.g. 2.1) of the SDMX-ML Generic Data format. The same applies if you specify a generic mime type, such as application/xml. Now, this could change in the future, when the service add supports for a newer version of the standard, and that change could break your client. So, don't rely on the default, and be sure to specify the desired format using the HTTP Accept header with a fully qualified mime-type (e.g.: application/vnd.sdmx.genericdata+xml;version=2.1). See the section about HTTP Content Negotiation for additional information.

Get only what you need

Let's say you want to get some exchange rates from a web service. And let's say you check regularly to see whether the rates have been updated. Do you want to get everything all the time, included all the data that have not changed, or do you want something more efficient? If it's the later, make sure to use the updatedAfter parameter. In the same vein, if you just want the data and don't need the associated metadata, say so using the detail parameter... For additional information, see the section about the parameters for data queries.

Opt for fat-free messages

Plain text formats (XML, JSON, CSV, etc.) compress very well. Compressed data are typically several times smaller than uncompressed ones. In our tests, the compressed files were between 3 and ... 47 times smaller than the uncompressed ones, depending on the type of query and the selected formats. So, in order to optimise network transfer times, request compressed representations of the data, using the appropriate HTTP Accept-Encoding header. See the section about HTTP Content Negotiation for additional information.

Check the response status code

The response status code is used to report potential issues. So, check it. It’s not always 200 (or 42). See the section about the error codes for additional information.