Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6927351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:02:35+00:00 2026-05-27T11:02:35+00:00

I am currently trying to decompress some data that I have coming in with

  • 0

I am currently trying to decompress some data that I have coming in with the ASIHTTPRequest wrappers.. but not sure what needs to be done. I have read the documentation but it dosnt give alot of detail..

This is what I have so far:
//.h

//Compression stuff
BOOL dataWasCompressed;
NSData *compressedResponse;
NSData *uncompressedData;
NSString *response;

//…

//.m

//Compression Test
- (IBAction)sendHttpsRequest
{
    //Start HUD
        [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack];
        [SVProgressHUD setStatus:@"loading..."];

        NSURL *url = [NSURL URLWithString:@"http://127.0.0.1:8888/testConnection/ClientDataSet.xml.compressed"];
        ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
        // YES is the default, you can turn off gzip compression by setting this to NO
        [request setAllowCompressedResponse:YES];
        [request startSynchronous];
        dataWasCompressed = [request isResponseCompressed]; // Was the response gzip compressed?
        compressedResponse = [request rawResponseData]; // Compressed data
        uncompressedData = [request responseData]; // Uncompressed data
        response = [request responseString]; // Uncompressed data as a string


    NSLog(@"compressed? %@", dataWasCompressed);
    NSLog(@"compressed Response = %@", compressedResponse);
    NSLog(@"uncompressed Data = %@", uncompressedData);
    NSLog(@"response = %@", response);
}

- (void)requestFinished:(ASIHTTPRequest *)request
{   
    self.hudCheck = YES;

    responseString = [request responseString]; //Pass requested text from server over to NSString 
    NSLog(@"Response String = %@", responseString);

    //removies the SVProgressHUD
    [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(stopAnimating) userInfo:nil repeats:NO];
}

And the response looks like this

2011-12-08 10:33:50.845 connectionTest[2049:207] compressed? (null)
2011-12-08 10:33:50.846 connectionTest[2049:207] compressed Response = <789c7d93 6d6f8230 1080ffca a53f6060 877b4900 d3292a99 4e036c7e 5ceaac8e 0d8b834e c55fbfc2 869238af 5fdaf4b9 bb5e9fb4 7667bf4e 602bb23c 4ea5435a 5726815c 71b9e049 2a85430a 91938e0b 60f758c4 a6acfbe8 45f05247 531dedda 632f6225 75edbeef 8d7ae1df 0c5ca94c f2b52ef2 90a689e0 b21f8b64 4160594e aad86830 ff05c438 cff1a512 2b919de7 c4d67fe1 a1ca62b9 3a8fceab 7d0233bf 170d1dd2 36cd32db a83b9db2 808d43e8 0ed9d3c0 7b1d4d06 5a019850 1d619c2e 164c66c7 0504e92e 545ce9e2 1681e6d5 1c1205cf 1e8166eb 5a92590f 028d2ef5 41269fbf 2dc472f5 1e7f7c26 6b996ebe b25c7d6f 77fbe2d0 6a218c22 ec1a6116 c2da08bb 41d82dc2 ee10767f 9951c40b 45bc50c4 0b45bc50 c40b45bc 50c40bbd e0a57a57 c7d7649c 3e95fb03 b0ff49b1>
2011-12-08 10:33:50.846 connectionTest[2049:207] uncompressed Data = <789c7d93 6d6f8230 1080ffca a53f6060 877b4900 d3292a99 4e036c7e 5ceaac8e 0d8b834e c55fbfc2 869238af 5fdaf4b9 bb5e9fb4 7667bf4e 602bb23c 4ea5435a 5726815c 71b9e049 2a85430a 91938e0b 60f758c4 a6acfbe8 45f05247 531dedda 632f6225 75edbeef 8d7ae1df 0c5ca94c f2b52ef2 90a689e0 b21f8b64 4160594e aad86830 ff05c438 cff1a512 2b919de7 c4d67fe1 a1ca62b9 3a8fceab 7d0233bf 170d1dd2 36cd32db a83b9db2 808d43e8 0ed9d3c0 7b1d4d06 5a019850 1d619c2e 164c66c7 0504e92e 545ce9e2 1681e6d5 1c1205cf 1e8166eb 5a92590f 028d2ef5 41269fbf 2dc472f5 1e7f7c26 6b996ebe b25c7d6f 77fbe2d0 6a218c22 ec1a6116 c2da08bb 41d82dc2 ee10767f 9951c40b 45bc50c4 0b45bc50 c40b45bc 50c40bbd e0a57a57 c7d7649c 3e95fb03 b0ff49b1>
2011-12-08 10:33:50.847 connectionTest[2049:207] response = x}mo0ÿÊ¥?``{I

So I am pretty sure that the Boolean value is not being set as its giving me a Null value.
Can you guys see what im doing wrong? Dose the data only get passed to requestFinished if the bool is set? or is there a deeper problem here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:02:35+00:00Added an answer on May 27, 2026 at 11:02 am

    ASIHTTPRequest only knows if the download is compressed if it’s being served by a server that sets the content-encoding HTTP response header to “gzip”.

    Is your test/web server doing this?

    Also, in your code, change your NSLog line to:

    NSLog(@"compressed? %@", dataWasCompressed ? @"YES" : @"NO" );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im currently trying to add some Style to my Hyperlinkbutton, but cannot get it
Im currently trying to refactor a project(asp.net mvc) that doesnt have any separation at
Currently trying at add ajax to a site, after much reading I discovered that
I currently trying to find a solution, how to ensure that a test fails
Im currently trying to downlaod a audio track from a WCF, i need some
Im currently trying to learn some stuff about encryption, it's algorithms and how it
I am currently trying to copy an array I have to a new view
I'm currently trying to make some ajax post between cross-domains by following this tutorial
I'm currently trying to pull data from a database using a variable and then
I´m currently trying to add the feature that is discussed here: http://blog.bmn.name/2008/03/jquery-fadeinfadeout-ie-cleartype-glitch/ A glitch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.