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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to