Content-Type for storage uploads

While working on converting a Maven plugin from API v1 to v2, I’ve come to the Add Storage call.

The documentation states regarding Content-Type:

The header must correspond to the template specified in the Media Types table

It refers to IANA’s registered Media Types, also known as Internet Media Types and MIME Types. The problem is that a lot of file types aren’t registered there - even a lot of the file types listed under Add File aren’t registered. IANA requires somebody to apply for registration for a certain type, and I’m confident there are some “red tape” involved in that process, so in short, nobody bothered to register many file types.

Technically, the above quoted text doesn’t say that the value of the field must be registered, but that it must “correspond to the template”. It’s unclear to me what that means. It could mean that a registered “template” must be used - which is impossible for unregistered file types, or it could mean that it must follow the form/syntax <category>/<detail>.

I find the documentation unclear, and when combined with “must”, it doesn’t feel good proceeding without knowing what Content-Type to use for unregistered files.

I assume that “general” types like text/plain or application/octet-stream can be used - but it’s unclear to me what the potential consequences are and what is the best solution.

I’d really appreciate some clarification, and ideally the documentation should be updated to make it clear to everybody how to handle this.

1 Like

Hi @Nadar!

Sorry for the inconvenience! We will pass your feedback to the team. Thank you for sharing it with us!

As for now, you can use application/octet-stream for Content-Type indeed.

2 Likes