By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

JSON decompressing

100+
P: 116
Hi

I am retrieving a file from a server, say http://www.abc.com/abc.json which is compressed.

What is the method of reading the response in vb.net (visual studio)? ie, decompressing it first then reading it?

My general method is as follows but it doesn't like reading the data since it's compressed I guess.

Expand|Select|Wrap|Line Numbers
  1. Dim Url As String = "https://www.abc.com/abc.json"
  2. Dim request As WebRequest = Nothing
  3. Dim response As WebResponse = Nothing
  4. Dim strResponseStatus As String = ""
  5. request = WebRequest.Create(New Uri(Url))
  6. request.Method = "GET"
  7. request.ContentType = "application/json-rpc"
  8. response = request.GetResponse()
  9.  
Thanks!
Oct 11 '14 #1
Share this Question
Share on Google+
4 Replies


iam_clint
Expert 100+
P: 1,208
If its compressed you need to know what kind of compression was used then decompress after you receive it.
Oct 12 '14 #2

100+
P: 116
ok - the decompressing bit I figured but that is the code I'm stuck on. as for the type of compression, that I can't be sure about but let's assume gzip.
Oct 13 '14 #3

iam_clint
Expert 100+
P: 1,208
http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx
system.io.compression namespace has a gzipstream
Oct 13 '14 #4

100+
P: 116
Thx Clint - been sidetracked on something at the moment but will try to check back with this shortly
Oct 27 '14 #5

Post your reply

Sign in to post your reply or Sign up for a free account.