Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Accessing http header in javascript

Reply
Thread Tools

Accessing http header in javascript

 
 
mngibson@gmail.com
Guest
Posts: n/a
 
      07-18-2006
Is there any way to access arbitrary http header information through
javascript? For example, if I wanted to obtain content-length? I
suspect not, but I'm not too knowledgable on js.

Thanks,
Mark

 
Reply With Quote
 
 
 
 
bobzimuta
Guest
Posts: n/a
 
      07-18-2006
If absolutely necessary, and the browser has XMLHttpRequest support,
you could send out a request for the same page again (note that's an
extra server request). You'll get all the response headers, via the
XMLHttpRequest->getAllResponseHeaders() or
XMLHttpRequest->getResponseHeader("headername") functions

Reference:
http://www.w3schools.com/dom/dom_http.asp

wrote:
> Is there any way to access arbitrary http header information through
> javascript? For example, if I wanted to obtain content-length? I
> suspect not, but I'm not too knowledgable on js.
>
> Thanks,
> Mark


 
Reply With Quote
 
 
 
 
Dr John Stockton
Guest
Posts: n/a
 
      07-19-2006
JRS: In article < .com>
, dated Tue, 18 Jul 2006 12:44:53 remote, seen in
news:comp.lang.javascript, posted :

>Is there any way to access arbitrary http header information through
>javascript? For example, if I wanted to obtain content-length? I
>suspect not, but I'm not too knowledgable on js.


<FAQENTRY>

Header information is important, and ISTM that it would be useful to be
able to find out about how to access it, starting by reading the FAQ -
so a suitable link would do.

I see three possibilities worth presenting :
code for using XMLHttpRequest;
a utility program which, given a URL,
will fetch the header material;
Telnet code
but there may be more.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP SOAP/HTTP GET/HTTP POST milan_9211 Software 0 01-10-2011 02:10 PM
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
How to Remove Http header from http response Vivek Mehta XML 3 08-12-2004 02:02 AM
What is better /standard for creating files. a cpp file with header or cpp and seperate file for header DrUg13 C++ 1 02-10-2004 09:20 AM
how to avoid using another header file inside a header file? Newsgroup - Ann C++ 4 11-02-2003 01:20 PM



Advertisments