Hi,
What about :
var request = new Http('http://www.google.fr/');
request.finish(function(result) {
for (var x in result['headers']) {
if (result['headers'].hasOwnProperty(x)) Ape.log(x);
}
});
(getContent doesn't return an object, you must use "finish" method).
Anthony
hadrienb a écrit :
Hello,
Here is something I can't resolve :
on the server side, I launch a Http request and I'm receiving the
response I'm waiting for.
So it's working properly but when I tried to read the headers of this
response it appeared to be empty...
The status value is '200', the body is ok but nothing (not "undefined"
or "object".. just nothing) in the headers.
Here is my server side javascript code :
(I also edited the Http.js file to get the entire response object, not
just the body...)
request.getContent(function(result) {
Ape.log('STATUS : '+result['status']);
Ape.log('HEADERS : '+result['headers']);
Ape.log('BODY : '+result['body']);
Ape.getPipe(params.pipe).sendRaw("data",
{"msg":result});
});
Something wierd (or not, I'm not sure^^) on the client side, after I
sent the response object through the sendRaw() function, the headers
is not empty but its value is '0'.
Could I have some help and/or explanation please? Thank you :)
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/