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 7896123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:48:45+00:00 2026-06-03T07:48:45+00:00

I have problem like this https://dev.twitter.com/discussions/4563 if (webResponse.Headers[Content-Encoding] == gzip) { byte[] bytes =

  • 0

I have problem like this https://dev.twitter.com/discussions/4563

               if (webResponse.Headers["Content-Encoding"] == "gzip")
                {
                    byte[] bytes = UTF8Encoding.Unicode.GetBytes(stream);
                    MemoryStream ms = new MemoryStream(bytes);
                    var rstream = new ICSharpCode.SharpZipLib.GZip.GZipInputStream(ms);
                    using (var reader = new StreamReader(rstream, Encoding.UTF8))
                    {
                        var st = reader.ReadToEnd();// Exception here: "Error baseInputStream GZIP header,  second byte doesn't match"
                        parameters = HelperMethods.GetQueryParameters(st);
                    }
                }

I use this lib: http://slsharpziplib.codeplex.com/

Update:
I use RestClient for post tweet only. For login I use:

var AccessTokenQuery = oAuthHelper.GetAccessTokenQuery(OAuthTokenKey, tokenSecret, VerifyPin);
            AccessTokenQuery.QueryResponse += new EventHandler<WebQueryResponseEventArgs>(AccessTokenQuery_QueryResponse);
            AccessTokenQuery.RequestAsync(TwitterSettings.AccessTokenUri, null);
  • 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-06-03T07:48:46+00:00Added an answer on June 3, 2026 at 7:48 am

    It looks like the gzip response you are receiving isn’t quite what SharpZipLib is expecting.

    The error you are getting is from SharpZipLib/src/GZIP/GzipInputStream.cs and is probably from this line:

    if (magic != (GZipConstants.GZIP_MAGIC & 0xFF)) {
                    throw new GZipException("Error GZIP header,  second magic byte doesn't match");
    }
    

    Try saving the stream to a file and then take a look at it. See if you can unpack it with 7-zip, etc. Then once you know what’s wrong you can go from there.

    Update:

    There appears to be a solution to the problem you are having at the end of the discussion you linked to and I wanted to make sure you were aware of it:

    @SMCApps
    I caught a break…

    Dim client = New RestClient() With { _
    .Authority = "https://api.twitter.com/oauth", _
    .Credentials = credentials, _
    .HasElevatedPermissions = True, _
    .SilverlightAcceptEncodingHeader = "gzip", _
    .DecompressionMethods = Silverlight.Compat.DecompressionMethods.GZip _
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem where I have some html like this <p>There is the
I have a problem with IE. I have a fixed div like this: #fixed
I have a problem with a jquery function. My HTML looks like this, I
Hello i have the following problem, I record a video using red5 like this:
I have a nHibernate query like this ICriteria query = session.CreateCriteria(typeof(MyResult)) .Add(Expression.Eq(ResultTypeId, myResult.ResultTypeId)) Problem
I'm having a problem. I have a UIView, that looks like this : In
This seems like a simple problem: I have a WF4 activity that guides the
This sounds like a problem many others have posted about, but there's a nuance
I have an issue that seems like very flaky behavour, is this a problem
I have problems running a dynamic LIKE statement in my project: this query works

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.