3

Is there any (un)official Gob MIME Type, such as application/x-gob? The official documentation never mentions any MIME type.

I am not sure if I should use the same approach as Protobuf, which stopped using specific types in favour of the generic application/octet-stream (see Protobuffer uses octet-stream as its default content type)

basgys
  • 4,320
  • 28
  • 39
  • 3
    AFAIK, the gob format isn't formalised anywhere. So I would think that `application/octet-stream` would fit. – Ainar-G Aug 29 '17 at 16:35
  • `application/octet-stream` is a catch-all and tells you *nothing* about the content. Your network connection must be between your own private nodes, I presume (gob makes little sense for a public endpoint). Should you consider transcoding into a recognised content type, e.g. to JSON? – Rick-777 Aug 30 '17 at 08:18
  • @Rick-777 Yes that's one of the trade-offs. I opted for the custom type `application/x-gob` internally, and use `application/octet-stream` when knowing the content type is not necessary. Yes JSON could be used for public APIs, but protobuf is a "recognised" type and has a generic type. – basgys Aug 30 '17 at 12:10
  • Looks like protobuf might have erred. See https://www.w3.org/Protocols/rfc1341/4_Content-Type.html - this suggests `application/x-gob` is your best bet. – Rick-777 Aug 31 '17 at 13:37

0 Answers0