801

javascript XMLHttpRequest headers

de ceva timp experimentez cu javascript, la moment ma chinui cu XMLHttpRequest. Din cate mi-am dat seamna http requesturile au request header si response header.Response headeru in pot vedea utilizand getAllResponseHeaders, de exempluvar req = null;try { req = new XMLHttpRequest(); } catch(e) {}if (!req) try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}if (!req) try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}req.open('GET', "http://example.com/getinfo.php?userid=3", false);req.send(null);alert(req.getAllResponseHeaders());Intrebarea consta in: Cum as fi putut vedea request headeru?XMLHttpRequest are setRequestHeader, eu am nevoie de ceva de felu getRequestHeader() . Cum pot sa o fac?
0