Oops. Sorry!

That was really obvious.

Henry

On 29 Nov 2007, at 07:14, Jerome Louvel wrote:


Hi Henry,

The technique to get all server request headers also works for the client response headers, using the same attribute specified here :
http://www.restlet.org/documentation/1.0/api/org/restlet/data/Message.html#getAttributes()

Best regards,
Jerome


2007/11/29, Story Henry < [EMAIL PROTECTED]>:I found some threads on this list on how to get the headers of a
request,
but as I am writing a client I am more interested in getting all the
headers
of a response.

HTTPUrlConnection hconn = (HTTPUrlConnection) url.getURLConnection();

hconn.connect();
Bnode response = factory.createBNode();

graph.addStatement(response,RDFS.instanceOf,factory.createResource("http://www.w3.org/2007/ont/http#ResponseMessage
"));

for(Map.Entry<String,List<String>> head:
hconn.getHeaderFields().entrySet()) {
        graph.addStatement(response,
                           factory.createResource(" 
http://www.w3.org/2007/ont/httph#
"+head.getKey().toLowerCase()),
                           head.getValue());
}

Then I can log all the headers in every message I come across.

How would I do that with Restlets?

Henry

Home page: http://bblfish.net/
Sun Blog: http://blogs.sun.com/bblfish/
Foaf name: http://bblfish.net/people/henry/card#me






Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to