Thanks a lot for the help and the framework :-)
I had not understood than one had to pass via the message class.
Thanks again,
Henry
On 25 Oct 2006, at 20:49, Jerome Louvel wrote:
Hi Henry,
The API doesn't provide concrete implementations because there
could be so many. You can compare it to the Servlet API which
simply provides an OutputStream.
However, the NRE does provide many concrete representation classes
(FreeMarker template, InputStream-based, OutputStream-based, DOM-
based, SAX-based, etc.) inside the core and extensions packages:
http://www.restlet.org/docs/core/
http://www.restlet.org/docs/ext/
To return a simple string, it's easier, just use the
Message.setEntity(String, MediaType) method. I will see how this
could be explained better in the docs.
Thanks,
Jerome
Henry Story a écrit :
Hi,
I am writing an Atom client and would like to POST an <entry> to a
collection. I looked at the atom source code, but could not quite
work out how this is meant to work.
As far as I can see one needs to do something like this
Request request = new Request(Method.POST, getHref(), member);
where member is a Representation. There does not seem to be any
way to set the content of a represenation, though. Should one
subclass it to make sure the
public InputStream getStream() throws IOException
public ReadableByteChannel getChannel() throws IOException
are implemented? And if so which? If so this should be documented...
Or perhaps I am thinking of this wrong.
Henry
Home page: http://bblfish.net/
Sun Blog: http://blogs.sun.com/bblfish/
Foaf name: http://bblfish.net/people/henry/card#me
--
Jerome Louvel
http://www.noelios.com