Parsing http head request resposnse from server.

Discussion in 'Javascript' started by Raaga, Feb 8, 2007.

  1. Raaga

    Raaga Guest

    Hi,

    I have written an Ajax application which can send http HEAD requests
    and receive the header response from server.
    Now I want to show the different values in formatted manner. However,
    there seems be no character or expression which I can use to split the
    HEAD response for string processing.

    Here is a sample of server response:

    Mime-Version: 1.0 Date: Thu, 08 Feb 2007 03:51:13 GMT Server: Apache/
    2.0.1a Content-Type: text/html; charset=utf-8 Content-Length: 69
    Connection: close

    If you have any information regarding this please do let me know.

    Regards,
    Raaga
    Raaga, Feb 8, 2007
    #1
    1. Advertising

  2. Raaga

    dev_jg Guest

    On Feb 7, 11:06 pm, "Raaga" <> wrote:
    > Hi,
    >
    > I have written an Ajax application which can send http HEAD requests
    > and receive the header response from server.
    > Now I want to show the different values in formatted manner. However,
    > there seems be no character or expression which I can use to split the
    > HEAD response for string processing.
    >
    > Here is a sample of server response:
    >
    > Mime-Version: 1.0 Date: Thu, 08 Feb 2007 03:51:13 GMT Server: Apache/
    > 2.0.1a Content-Type: text/html; charset=utf-8 Content-Length: 69
    > Connection: close
    >
    > If you have any information regarding this please do let me know.
    >
    > Regards,
    > Raaga


    Try to write out the charCodes of all the characters peresent in the
    string you get from server, to see if there were any unprintable
    char's, you may see char 13 or 10's in there

    var resp//
    var i=0
    for(i=0;i<resp.length;i++)
    {
    document.write(resp.charAt(i)+" ----------> "+resp.charCodeAt(i)
    +"<br>")
    }

    let me know what you see
    Jas
    dev_jg, Feb 8, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian W
    Replies:
    10
    Views:
    750
    Brian W
    Jul 2, 2003
  2. showme

    PHP and ASP.NET go HEAD to HEAD

    showme, Jul 8, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    709
    Sherif ElMetainy
    Jul 10, 2004
  3. Karl
    Replies:
    0
    Views:
    383
  4. Jiho Han

    Write into <HEAD></HEAD> section?

    Jiho Han, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    218
    Sam Fields
    Jan 16, 2004
  5. Trans

    HTTP head request

    Trans, Sep 24, 2007, in forum: Ruby
    Replies:
    4
    Views:
    95
    Eric Hodel
    Oct 5, 2007
Loading...

Share This Page