Thanks Thierry, I will try the new snapshot when it is ready.

I tried to do customized request header by calling Form with key and value, and 
request.getAttribute​s().put("org.re​ stlet.http.headers​", form), but I 
encountered warnings, eg "WARNING: Addition of the standard header "Host" is 
not allowed. Please use the Restlet API instead", "WARNING: Addition of the 
standard header "User-Agent" is not allowed. Please use the Restlet API 
instead", etc. 

Is there a way to get rid of the warnings?

Thanks,

Nicho



> Hello Nicho,
> 
> thanks for reporting this. The fix is available in the svn repository and 
> will be available in the next snapshot (in a 2 hours): 
> http://www.restlet.org/downloads/1.1/
> 
> Regarding the usage of the "org.restlet.http.h​eaders" attribute, if it is 
> null, you can create and set it as follow:
> Form form = new Form();
> form.add("key", "value");
> request.getAttribute​s().put("org.re​ stlet.http.headers​", form);
> 
> Please note that the "User-Agent" can only be set via the ClientInfo#agent 
> property, as it is a standard HTTP header.
> 
> Please note also, that you can set the clientInfo#agent with only one line of 
> code as follow:
> request.getClientInfo().setAgent("My new Agent/1.0");
>  
> 
> Best regards,
> Thierry Boileau

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2463196

Reply via email to