POST with accept variants

2011-07-04 Thread Chris Davis
I want to be able to return an XML or JSON response from a POST request depending on the HTTP accept header and was wondering if its possible to leverage the existing variant stuff from the represent(variant) method from within the POST handler? or do I just need to check the header manually? th

RE: Multiple applications with serverservlet and < v2.0

2011-04-14 Thread Chris Davis
ok no worries I just found the component javadoc -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2719712

Multiple applications with serverservlet and < v2.0

2011-04-13 Thread Chris Davis
Quick question is it possible to have multiple restlet applications with restlet < 2.0 (e.g.1.1.9) when using the servlet extension and config in a web.xml file? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2719537

RE: Re: Reading/setting date header fields is extreme slow on android

2011-02-18 Thread Chris Davis
I have also come across this problem, the restlet client chooses between using simpledateformat and internetdateformat depending on the format of the date header passed to it. simpledateformat is slow because it loads all the timezone names for each instance. It is possible that if your server

RE: Re: ClientResource without error? (Restlet 2.0.5)

2011-02-17 Thread Chris Davis
Oh I thought he only wanted the status. but could you not just call res.getResponse().getEntity()? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2705025

RE: ClientResource without error? (Restlet 2.0.5)

2011-02-16 Thread Chris Davis
Surround the get() with a try catch, catch the resource exception and check the status there as well as after the get(), something like ClientResource res = new ClientResource(); Status stat; try{ res.get(); stat = res.getStatus(); } catch (ResourceException e){ stat = res.getStatus(); } --

RE: Problem using android 2.0.4 and apache http client with HTTPS

2011-02-14 Thread Chris Davis
Any word on why it was removed? and more relevantly is it safe to use? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2703914

RE: Problem using android 2.0.4 and apache http client with HTTPS

2011-02-07 Thread Chris Davis
I extended the HttpClientHelper and overrode configure to register the https scheme schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443)); and now have https working So now just the other problem where the client seems to stop in the middle of making multiple

RE: Problem using android 2.0.4 and apache http client with HTTPS

2011-02-07 Thread Chris Davis
Ignore that last problem I mentioned it was my fault. I had a static Client object but was also using a Decoder that had a shorter lifecycle. So when the Decoder was finalized it was of course calling stop() on the Client -- http://restlet.tig

RE: Problem using android 2.0.4 and apache http client with HTTPS

2011-02-07 Thread Chris Davis
OK I can see in the HttpClientHelper that it only registers the http scheme and not the https as its own javadoc says /** * Configures the scheme registry. By default, it registers the HTTP and the * HTTPS schemes. * * @param schemeRegistry *The scheme r

Problem using android 2.0.4 and apache http client with HTTPS

2011-02-04 Thread Chris Davis
Hi, I've been having trouble to getting the apache http client working on android. I have the restlet.jar and ext.httpclient.jar on my class path and I am adding the HttpClientHelper as per the instructions, Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null )); I am

RE: Re: Inefficient parsing of date header clientresource 2.0.3

2011-01-25 Thread Chris Davis
I see after more digging that InternetDateFormat was added in 2.0, if I do upgrade the server side will it use an offset timezone rather than a timezone code by default? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=

RE: Re: class not found exception android 2.0.3

2011-01-17 Thread Chris Davis
No I've only had that single crash report, I'm putting it down to an android OS bug -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2698685

class not found exception android 2.0.3

2011-01-13 Thread Chris Davis
I've received a strange crash report from an android device using restlet 2.0.3 for android. It looks like the classloader is trying to load org.joda.time.DateTime when initialising org.restlet.engine.Engine but I have no idea why it would try to do that as there are no references to that class any

Enabling gzip for clientresource

2010-09-17 Thread Chris Davis
Hi, How do I enable support for using gzip from the android client code? I don't necessarily need to gzip the request but would like to set the accept-encoding:gzip header and unzip the response. cheers Chris D -- http://restlet.tigris.org/ds/

Decoding url encoded form values

2010-09-09 Thread Chris Davis
Hi, I am posting a x-www-form-urlencoded form (using the restlet client api) and getting the value on the server in my the acceptRepresentation method using: Form form = new Form(entity) form.getFirstValue() The value is url encoded but my question is should I have to decode the value myself or

RE: Correct way to use android ClientResource

2010-08-03 Thread Chris Davis
I've traced further into the code and it seems to be the BaseHelper class that is creating a controller service and worker service. This happens for each new clientresource object. I currently have a clientresource object for each of my resources, is this the right way to go about it or should

Correct way to use android ClientResource

2010-08-02 Thread Chris Davis
Just a quick one, (i hope) I am using the android ClientResource in my android app and I am wondering what is the correct way to use that object when it is necessary to make multiple requests on it. Should I be creating one resource object and holding a reference to that or is it preferable to cre

Multipart form post from android client

2010-05-06 Thread Chris Davis
Hi, I was wondering if you guys had implemented the multi-part form request in the android client lib yet? If not I understand I can use the apache httpclient? could anyone point me at a good example of how to do this? thanks in advance Chris D

Considering Restlet for my web service

2009-07-28 Thread Chris Davis
Hello, I am currently trying to implement web service that will run on our existing servlet based system. Restlet looks almost perfect for what I need but there are two things that I need to be sure I can do before I can proceed with it. 1) Authentication - I need to allow a user to authenticate