Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ajax & web service

2 views
Skip to first unread message

Herb Munson

unread,
Feb 25, 2009, 4:54:40 PM2/25/09
to dev-...@lists.mozilla.org
Is it possible to use js and xmlhttprequest to send an HTTP request directly
to a web service?

In FireFox 3.0.6, setRequestHeader("Host", "www.ecubicle.net") in my js code
appears to be ignored. The rest of the process works (other headers get
set, "send" sends, the readystatechange handler fires, and a message
arrives) but the responseText is just error information telling me "the
resource cannot be found". "Live HTTP Headers" makes the reason obvious; in
the HTTP request message, "Host" is still "localhost". (And indeed,
http://www.w3.org/TR/XMLHttpRequest/#setrequestheader says "For security
reasons." setRequestHeader should abort if the header argument == "Host".)

So, is this hardwired into Mozilla's setRequestHeader, and is there no way
around it??

Is there no way to tell Mozilla that it is OK to exchange messages with a
particular domain? (BTW, I've had no better luck with IE 7.)

Thanks for any help.

Herb

0 new messages