Accessing http header in javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mngibson@gmail.com

    #1

    Accessing http header in javascript

    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

  • bobzimuta

    #2
    Re: Accessing http header in javascript

    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->getAllResponse Headers() or
    XMLHttpRequest->getResponseHea der("headername ") functions

    Reference:
    Sorry! We can't seem to find the resource you're looking for


    mngibson@gmail. com 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

    Comment

    • Dr John Stockton

      #3
      Re: Accessing http header in javascript

      JRS: In article <1153251893.438 945.181900@b28g 2000cwb.googleg roups.com>
      , dated Tue, 18 Jul 2006 12:44:53 remote, seen in
      news:comp.lang. javascript, mngibson@gmail. com 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.c om/faq/>? JL/RC: FAQ of news:comp.lang. javascript
      <URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
      <URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.

      Comment

      Working...