Re: response MediaType with parameter
Hello Zsolt, thanks for your report, since this is a bug (following section 3.7 of the HTTP RFC). It will be fixed soon. best regards, Thierry Boileau Hello I'd like to response an atom entry with content-type header: 'application/atom+xml; type=entry'. I have an AtomRepresentation class (extends OutputRepresentation), which contains the following constructor: public AtomEntryRepresentation() { super(MediaType.APPLICATION_ATOM_XML); getMediaType().getParameters().add(type, entry); System.out.println(getMediaType().toString()); // this prints the type parameter correctly } When I response this representation to the client, the content-type header contains only the type without the 'type' parameter. # curl -v http://localhost:8182/czinkos/resource/ HTTP/1.1 200 The request has succeeded Content-Type: application/atom+xml Date: Thu, 17 Jul 2008 15:05:47 GMT Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Server: Noelios-Restlet-Engine/1.1.m4 Connection: close Transfer-Encoding: chunked atom:feed xmlns:atom=http://www.w3.org/2005/Atom; atom:id/ atom:titleRoot collection for user czinkos/atom:title atom:updated2008-07-17T14:58:44,812Z/atom:updated atom:published2008-07-17T14:58:44,812Z/atom:published * Closing connection #0 /atom:feed What am I doing wrong? Thank you Zsolt
Re: response MediaType with parameter
Hi Zsolt, thanks for having reported this issue. best regards, Thierry Boileau Hello It works, thanks a lot. Just a note for the record. The code I wrote is incorrect, since it adds a 'type' parameter to MediaType.APPLICATION_ATOM_XML on every instance creation (since it is static). Following works correctly: public AtomEntryRepresentation() { super(new MediaType(application/atom+xml)); getMediaType().getParameters().add(type, entry); } Thanks again. Zsolt On Fri, Jul 18, 2008 at 11:11 AM, Thierry Boileau [EMAIL PROTECTED] wrote: Hi Zsolt, I've updated the svn repository. Could try it? best regards, Thierry Boileau Hello I'd like to response an atom entry with content-type header: 'application/atom+xml; type=entry'. I have an AtomRepresentation class (extends OutputRepresentation), which contains the following constructor: public AtomEntryRepresentation() { super(MediaType.APPLICATION_ATOM_XML); getMediaType().getParameters().add(type, entry); System.out.println(getMediaType().toString()); // this prints the type parameter correctly } When I response this representation to the client, the content-type header contains only the type without the 'type' parameter. # curl -v http://localhost:8182/czinkos/resource/ HTTP/1.1 200 The request has succeeded Content-Type: application/atom+xml Date: Thu, 17 Jul 2008 15:05:47 GMT Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Server: Noelios-Restlet-Engine/1.1.m4 Connection: close Transfer-Encoding: chunked atom:feed xmlns:atom=http://www.w3.org/2005/Atom; atom:id/ atom:titleRoot collection for user czinkos/atom:title atom:updated2008-07-17T14:58:44,812Z/atom:updated atom:published2008-07-17T14:58:44,812Z/atom:published * Closing connection #0 /atom:feed What am I doing wrong? Thank you Zsolt
response MediaType with parameter
Hello I'd like to response an atom entry with content-type header: 'application/atom+xml; type=entry'. I have an AtomRepresentation class (extends OutputRepresentation), which contains the following constructor: public AtomEntryRepresentation() { super(MediaType.APPLICATION_ATOM_XML); getMediaType().getParameters().add(type, entry); System.out.println(getMediaType().toString()); // this prints the type parameter correctly } When I response this representation to the client, the content-type header contains only the type without the 'type' parameter. # curl -v http://localhost:8182/czinkos/resource/ HTTP/1.1 200 The request has succeeded Content-Type: application/atom+xml Date: Thu, 17 Jul 2008 15:05:47 GMT Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept Server: Noelios-Restlet-Engine/1.1.m4 Connection: close Transfer-Encoding: chunked atom:feed xmlns:atom=http://www.w3.org/2005/Atom; atom:id/ atom:titleRoot collection for user czinkos/atom:title atom:updated2008-07-17T14:58:44,812Z/atom:updated atom:published2008-07-17T14:58:44,812Z/atom:published * Closing connection #0 /atom:feed What am I doing wrong? Thank you Zsolt