Hi Henry, Thanks for the feed-back. That's true about the documentation... and we are aiming at fill this gap, first by collaboratively writing a reference manual at: http://wiki.restlet.org
I encourage you to participate and ask for an author account if you have a few spare cycles! Best regards, Jerome > -----Message d'origine----- > De : Story Henry [mailto:[EMAIL PROTECTED] > Envoyé : jeudi 25 octobre 2007 14:55 > À : [email protected] > Objet : Re: client side content negotiation > > Thanks, that was very helpful. > > My feeling is that the Restlet documentations for client side > applications needs to be enlarged. > It is really short compared to the documentation for server > side, and > it is not always obvious exactly how to do things. > > Thanks again, > > Henry > > PS. The code I am writing and that is using Restlet is available in > http://sommer.dev.java.net/ > It is in the misc/AddressBook directory > You can log in as guest to get the subversion trunk. > > > On 18 Oct 2007, at 14:11, Thierry Boileau wrote: > > > Hello Henry, > > > > this kind of properties is not set on the client (or instances of > > "Client" class), but on the request sent by the client. > > > > the following instruction set the preference for media type > > "application/rdf+xml" with the default quality (1 actually): > > request.getClientInfo().getAcceptedMediaTypes().add(new > > Preference<MediaType>(MediaType.APPLICATION_RDF_XML)); > > > > You can also use this constructor: Preference(T metadata, float > > quality) [1] > > > > best regards, > > Thierry Boileau > > > > [1] see http://www.restlet.org/documentation/1.0/api/org/restlet/ > > data/Preference.html > > > >> Sorry to ask a basic question here. I could not find a > simple answer > >> in the doc. > >> > >> I would like to specify that my client prefers certain mime types > >> over others. So I would like to set the > >> "Accept" header. With the java.net framework I would just do this: > >> > >> URLConnection conn = idurl.openConnection(); > >> conn.addRequestProperty("Accept", > "application/rdf+xml, text/ > >> html; q=0.2"); > >> > >> how do I do this in Restlets? > >> > >> It would be nice to also be able to specify some default > consumers of > >> the different representations... > >> > >> Henry > >> > >> Home page: http://bblfish.net/ > >> Sun Blog: http://blogs.sun.com/bblfish/ > >> Foaf name: http://bblfish.net/people/henry/card#me > >

