I read this question but it doesn’t fully answer mine.
In the linked question, the OP asks what he must do to have his custom media type registered. I do not need that.
All I’m asking is, that if I am correct in assuming that, technically, all I have to do to create a custom media type is to, well.. just use it in my communication?
Basically, what I want to do is that my website offers a download of a file, described as application/x-my-custom-thing
. On the client, the user has files ending with .my-custom-thing
set as to open with the application I ship along.
So, what should happen is that, when the user clicks on the link, my application opens and reads the file and does stuff with it.
Are media types even the proper use case for this? Or, should I maybe “create” my own protocol in the sense of mycustomthing://example.com/the-file-to-use
? Will that work with every (reasonably modern) browser?
The primary purpose for media types used in HTTP communication is to tell the browser how they should treat the received content.
If you use the browser just to let the user to download the files to their computer, then you don’t need to create your own media type. It will be sufficient to use the standard generic media type application/octet-stream
.
If you want the browser to do more, then the user (or perhaps an installer) must associate your custom media type with your application. There is no automatic association and no relation between file extensions and media types (and some OSes don’t even use the file extension to identify the type of file and how to open it).
Defining a custom protocol is unlikely to work. A protocol defines how the browser communicates with a server and browsers will not accept URIs with a protocol that they don’t know.
2