Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2m-iwg] M2M Media Type?

Great questions, let me try and clarify:

 

The Media Type is supposed to give enough information to the receiver to properly handle a piece of data. In this instance when I say 'handle' I do not mean that the receiver simply knows how to deserialize the data, but rather that the Media Type indicates how the receiver should (1) deserialize the data, (2) lookup an appropriate handler, and (3) interpret the data.

 

Presently, you are correct. The common use case of a Media Type is to designate how a piece of data ought to stored and represented, generally for a user or web service to consume; for example 'application/json' indicates JSON content and 'application/xml' indicates XML content, however, the failure of using just 'application/json' or any of the other generic Media Type's is that they do not tell the receiver if it is information it can handle; instead the receiver must actually begin to process the data to discover that information.

 

However, Media Types can be more granular and there is definitely a school of thought in the ReST world at least that Media Type's should be domain specific. In the M2M world we would do well to define certain data types that could be represented under a common M2M Media Type. Rather than sending an arbitrary JSON payload to or from a device identified as 'application/json' what if we could use 'm2m/sensor-record+json' to indicate that the data is key/value pairing sent from a sensor and that it is represented in JSON?

 

Hopefully that clears up some confusion...

 

- PL

 

From: m2m-iwg-bounces@xxxxxxxxxxx [mailto:m2m-iwg-bounces@xxxxxxxxxxx] On Behalf Of Nicholas Humfrey
Sent: Wednesday, September 18, 2013 4:26 AM
To: m2m Industry Working Group
Cc: m2m Industry Working Group (m2m-iwg@xxxxxxxxxxx)
Subject: Re: [m2m-iwg] M2M Media Type?

 

I am not quite clear what the purpose of this would be?

 

Normally media types are associated with specific file formats, not intended purpose?


Sent from my phone


On 17 Sep 2013, at 21:38, Philip Lombardi <plombardi@xxxxxxxxx> wrote:

Hey folks,

 

Does anyone in the m2m-iwg think there should be an M2M/IoT IANA registered root media-type?  For example, instead of “application” we could use “m2m” to indicate this content-type is intended for machine consumption.

 

Could save some bytes too on all those HTTP requests flying around J. Anyone have experience with attempting to define officially recognized root media types?

 

Cheers,

Phil

 

_______________________________________________
m2m-iwg mailing list
m2m-iwg@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2m-iwg


Back to the top