Hi Ivan,

- do I need to call getMetadataService.addExtension("xyz",
MediaType.valueOf("application/vnd.aaa.bbb+json"))? YES

and what should be the extension value "xyz"? Up to me? YES as long as there
is no conflict with default extensions

- what should be the value of @Get? "xyz"? YES

- do I need to define why own class for the representation? The format of my
media type is JSON, but I cannot use JsonRepresentation because its media
type is "application/json". NO, you can use generic representation classes
such as WriterRepresentation

- any code examples for using own media types? Not sure, but there isn't
much more. Feel free to contribute a section to the user guide/wiki once you
got it working.

Best regards,
Jerome
--
http://www.restlet.org
http://twitter.com/#!/jlouvel


-----Message d'origine-----
De : Ivan [mailto:[email protected]] 
Envoyé : mardi 29 novembre 2011 09:33
À : [email protected]
Objet : RE: Own media type

Does anyone have an idea how to support own media type for a server
resource? I can't believe everyone is fine with just standard types like
application/json or application/xml.. Quite often to build truly RESTful
system you have to define own media types. Unfortunately from the
documentation it wasn't clear how to do in Restlet.

Ivan

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=28888
44

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2889018

Reply via email to