Ok, I see from comments that you are using phone7 - the story is slightly different than mainstream silverlight as there is ONLY ClientHttp stack and you will need to manually decompress, as you have found out.
I use Silverlight.SharpZipLib for this purpose.
Here is a method that will work in Silverlight and Phone 7. You can use it for API calls as well as others as it will check for gzip and respond accordingly.
private static string GetResponseText(WebResponse response)
using (Stream stream = response.GetResponseStream())
if (stream == null)
throw new Exception("response stream null");
var buffer = new byte;
using (var ms = new MemoryStream())
while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
ms.Write(buffer, 0, read);
data = ms.ToArray();
// check for magic numbers
if (data.Length > 2 && (data == 31 && data == 139))
using (var ms = new MemoryStream(data))
using (var gzip = new GZipInputStream(ms))
using (var reader = new StreamReader(gzip))
responseText = reader.ReadToEnd();
responseText = Encoding.UTF8.GetString(data, 0, data.Length);
ALL output from the API is gzipped.
There are two stacks available in silverlight:
BrowserHttp - supports transparent gzip - see Soapi.CS source code for a working example, but I will try to provide an isolated spike below.
ClientHttp - does not support gzip - you will need determine if the content is gzipped and decompress manually - using perhaps Silverlight.SharpZipLib. But really there are other issues that surface when trying to use the ClientHttp stack so I do not recommend this approach.
So, if you have a line of code in your app resembling
remove it and you should get better results.