Hi,
I am using Restlet 1.1.8 to work out the client request header but stuck.
my code is:
Client c = new Client( Protocol.HTTP);
Request request = new Request(Method.POST, new
Reference("http://localhost:8182/CSR"), getRepresentation());
ClientInfo info = new ClientInfo();
info.setAgent("My new Agent/1.0");
request.setClientInfo(info);
Response response = c.handle(request);
but the User-Agent is still is Noelios-Restlet-Engine/1.1.4, not "My new
Agent/1.0".
I also try code:
Client c = new Client( Protocol.HTTP);
Request request = new Request(Method.POST, new
Reference("http://localhost:8182/CSR"), getRepresentation());
Series<Parameter> headers =
(Series)request.getAttributes().get("org.restlet.http.headers");
headers.add("User-Agent", "My new Agent/1.0");
request.getAttributes().put("org.restlet.http.headers", headers);
but the headers is null.
any idea to point out where is my problem?
Thanks in advance,
Nicho
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2463103