AJAX HTTP protocol response problem with custom server -
i've started add http support custom c# non-webserver application seems work fine firefox/ie/chrome when typing in url directly browser - can see returned text string in page application.
the problem when try same httprequest in javascript on web page don't response chrome or firefox (it's fine in ie) - rather status of 0 httprequest object. can see application debug output received request browser , provided response browser must not response send in case exception of ie being less picky.
i've swapped between trying different post , requests no avail - eg:
request.open('get', url, true); request.onreadystatechange = mycallback; //request.setrequestheader('content-type', 'application/x-www-form-urlencoded'); request.send(null); //tried '' , other data post
my simplest server reply have tried is:
http/1.1 200 ok\r\n content-length: 20\r\n content-type: text/plain\r\n \r\n ...........
i have tried 1.0 instead of 1.1, different headers such connection: close, accept-ranges , other random stuff tried mimic other such responses looked @ wireshark.
obviously must simple magic combination eludes me!
many in advance.
and on note have answered own question cross domain security feature.
which have fixed adding response header:
"access-control-allow-origin: *"
hopefully useful else in future!
Comments
Post a Comment