Restlet with GWT to call REST service using HTTP DIGEST

im using GWT 2.2 and restlet-gwt-2.1m4.

im trying to call a holiday service that uses http digest.

So, I used the tutorial on Restlet widgets:

http://wiki.restlet.org/docs_2.1/13-restlet/27-restlet/46-restlet/112-restlet.html

The first thing that does not compile:

ChallengeResponse challengeResponse = new ChallengeResponse(c1, resource.getRequest(), resource.getResponse(), "login", "secret".toCharArray()); 

So, I changed it to

  // 2- Create the Challenge response used by the client to authenticate its requests. ChallengeResponse challengeResponse = new ChallengeResponse(ChallengeScheme.HTTP_DIGEST, "login", "secret"); 

My second problem is that the request is not sent. I checked with Firebug and there is nothing (without a GET request).

It seems that resource.get (); sends nothing.

Any idea what I am missing? Does the code in the tutorial really work?

Thank you in advance

+4
source share
1 answer

I found the correct code example from this link:

http://wiki.restlet.org/docs_2.1/13-restlet/275-restlet/144-restlet/189-restlet.html

That works great

0
source

All Articles