Request request = new Request(Method.GET, "https://www.awebsite.com/login"); Client client = new Client(Protocol.HTTPS); Response response = client.handle(request); ... response.getEntity().write(System.out);
But I don't know how to set the login parameters…
I want code that
- does the escaping etc
- can switch between get/post easily
Being a REST-based platform, I'm thinking I might need to use some parameter "representation" but that seems a bit strange. I'd think it would be common enough to build in this representational exception.
If by "login parameters" you mean sending credentials using Basic HTTP Authentication, it's done using Request.setChallengeResponse() like so:
This will work for any Request, using any HTTP method.
BTW, you might get faster/better responses by posting to the Restlet-Discuss mailing list; I've been on there for a year and a half and it's a great community.