Beautiful.

I was aware of the notion of "handle", but it reminds me of event handling, after a fact, rather than a priori driving an event or fact.

Thank you.

On Oct 8, 2008, at 8:40 AM, Thierry Boileau wrote:

Hi Mark,

the client can simply handle your request since it inherits from the Uniform class [1]:

Request request = new Request(Method.PUT, "http://blabla/";);
request.getCookies().add(name, value);
Client client = new client(Protocol.HTTP);
Response response = client.handle(request);


[1] http://www.restlet.org/documentation/1.1/api/org/restlet/Uniform.html
You will see that all methods such as get, put, post are defined in the Uniform class which is quite central in the framework => http://www.restlet.org/documentation/1.1/tutorial#conclusion


Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


Good day.

I read this post

http://restlet.tigris.org/servlets/ReadMsg? listName=discuss&msgNo=5135

because the subject sounded similar to my current problem.

My existing newbie model consists of a run-up to a PUT that looks like this:

Client client = new Client(Protocol.HTTP);
String baseUri = "/someuri";
String cookie = "thecookie";
// somehow set this cookie on the Request, but how?
Response response = client.put(baseUri, createEntityRep());
// ... postprocessing

So I can see from the post above how one can create a new Request, then set the cookie on the request via setCoookies(), but I don't see how one takes that Request and slipstreams back into the Client semantics, where Protocol.HTTP has been set and appears to await the ensuing "put".

Can someone post some complete sample code showing how, or whether, Client still participates in this flow when request headers must be set prior to send.

Thank you.

Reply via email to