×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2010
    Location
    Trivandrum ,Kerala
    Posts
    139

    How to handle GZIP-ed ajax responses?

    Do you have any suggestions on how to handle GZIP-ed ajax responses from a webservice with WRT?My code is working fine on emulator but not on devices (N8,X7).Does smartphone browser supports HTTP- Compression(gzip)?
    sreerajvr

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: How to handle GZIP-ed ajax responses?

    >> Does smartphone browser supports HTTP- Compression(gzip)?

    Yes. Ideally it should work on device if it works on emulator.

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: How to handle GZIP-ed ajax responses?

    Hi,

    Basically browser takes care of gzipped content and response is decompressed, when it reaches onreadystatechange handler.
    Gzip shoul be supported in mentioned handsets as well.

    Sreerajvr, I'll get back to you via PM.

    Br,
    Ilkka

  4. #4
    Registered User
    Join Date
    Oct 2010
    Location
    Trivandrum ,Kerala
    Posts
    139

    Re: How to handle GZIP-ed ajax responses?

    Hi ,

    Thank you so much for your reply!!.Yes gzip can be decompressed by WRT...Now I change my query a little bit ,have any method to extract response headers other than 'conent-type' and 'content-encoding using WRT?

    My code as follows:

    function init(){
    var conreq = new XMLHttpRequest();
    conreq.open("get", "http://www.google.com", true);
    conreq.onreadystatechange = function(){
    if (conreq.readyState == 4) {
    if (conreq.status == 200) {
    var xmlfile = conreq.responseText;
    headers = conreq.getAllResponseHeaders();
    alert(headers);


    }

    }

    }
    conreq.send(null);
    }

    WRT can not extract headers other than 'conent-type' and 'content-encoding'.But in emulator, it shows all header details like server, set-cookie etc.
    Last edited by sreerajvr; 2012-02-24 at 09:20.
    sreerajvr

  5. #5
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: How to handle GZIP-ed ajax responses?

    Hi,

    There is one more to add that list: Content-Disposition. According to my empirical study, those three are only ones, that can be accessed from the JavaScript.
    Rest of the headers cannot be accessed, including custom headers. Of course there might be some others as well, that I don't know of.

    It is true, that emulator is not 100% match to device in this regard.

    Br,
    Ilkka

  6. #6
    Registered User
    Join Date
    Oct 2010
    Location
    Trivandrum ,Kerala
    Posts
    139

    Re: How to handle GZIP-ed ajax responses?

    Thank you so much Ilkka.
    sreerajvr

Similar Threads

  1. WBXML responses
    By leprikon in forum OMA DM/DS/CP
    Replies: 1
    Last Post: 2008-07-03, 17:50
  2. Dialogless responses to SendRequest
    By zinedinesmith in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-08-02, 14:53
  3. Help!. Comms responses meter
    By djorge in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-07-27, 19:21
  4. Help!. Comms responses meter
    By djorge in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-07-27, 08:49
  5. Do not see AT-command responses
    By Marat Khalili in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-01-04, 13:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×