Hello Clement, basically, the request has to be updated as follow:
Form headers = (Form) request.getAttributes().get(HeaderConstants.ATTRIBUTE_HEADERS); if (headers == null) { headers = new Form(); request.getAttributes().put("org.restlet.http.headers", responseHeaders); } headers.add("X-Some-Header", "the value"); As I don't know how you issue your client requests, please feel free to ask for more details. >and also any information about the support of GWT 2.3... I've just fixed the generation of the snapshot of the current trunk : http://www.restlet.org/downloads/unstable Best regards, Thierry Boileau Hello, > > I'm brand new on this forum... Actually, I'm trying to use the restlet > client part framework to send a request to an existing REST server which > needs custom attributes in the HTTP header. I've tested and read that GWT > 2.3 is not yet supported, so I 'm using GWT 2.2 with the pacakge > "org.restlet.gwt" 2.1-M3. > > I've tried your solution, but when I'm debugging the request sent via > Firebug, I can see that my custom attributes are added in an overall > attribute called "Access-Control-Request-Headers", so the values are not > included, just the attributes names are included, and it's not well > understood by the remote REST server... > > => What I would like to have : > > GET http://[...] > Host: [...] > User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) > Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip,deflate > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Keep-Alive: 115 > Proxy-Connection: keep-alive > Origin: http://127.0.0.1:8888 > first-custom-attribute: firstValue > second-custom-attribute: secondValue > > > => What I got : > > OPTIONS http://[...] > Host: [...] > User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) > Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17 > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip,deflate > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Keep-Alive: 115 > Proxy-Connection: keep-alive > Origin: http://127.0.0.1:8888 > Access-Control-Request-Method: GET > Access-Control-Request-Headers: > first-custom-attribute,second-custom-attribute > > > If you have any idea... and also any information about the support of GWT > 2.3... > > Thanks > Bye, Clement. > > > -- > View this message in context: > http://restlet-discuss.1400322.n2.nabble.com/How-to-add-header-for-http-request-tp5662743p6397880.html > Sent from the Restlet Discuss mailing list archive at Nabble.com. > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2746930 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2748087