Skip to content

Content type header

Javier Otegui edited this page Dec 28, 2016 · 1 revision

Content-Type header

Files must be sent to the API via HTTP POST requests. The API is designed to accept many different types of files, and in order to simplify code and improve reliability, users have to explicitly specify the type of file, by using the Content-Type header.

Currently, these are the supported file types and their corresponding Content-Type value:

File type Implemented Extension Content-Type
CSV * .csv text/csv
Tab separated * .txt or tsv text/tab-separated-values
DarwinCore Archive .zip application/zip
DarwinCore Archive (preferred) .zip application/x-dwca
JSON .json application/json

Note the (future) use of application/x-dwca for DarwinCore Archives. Even if they are zip files, they are special in the sense that (ideally) all share the same structure, and these zip files could be different than other zip files. For example, if a user sends a DWCA with a custom id field, this field will be reflected in the meta.xml file, so the service might be able to parse this file looking for the proper value of the id field.

Clone this wiki locally