Well, think of it this way. You can open a text document in Notepad and read it. But what happens if you zip the text document? Try open up the zip file in notepad, it just wont work... You need to unzip it first.
I've tried it m8..it doesn't seem to work for me because i get all those square chars back from the server response..and that soft can't decode that xD
Mars base one Username: Jim Davis Password: yCrm33
Posts
1,284
Re: http response decode
Just like i told you, you are missed something. VBzlib1.dll is able to decompress a gzip'ed response.
Here is the example, i modified, to use a winsock to connect to any server, then get any URI. also its able to accept the response as gzip compressed.
My code split up the response, into each fields. Walk thru the code, to learn how it could be done. Mine is not the best code, but its fairy good for a demo. Theres some HTTP response variants i included, for better compatibility!
Dont forget to download the vbzlib1.dll, and just place it in the folder where the app is executed, thats all.
-------------------------------
By default, the server is www.zlib.net, and the ULR field is empty. Its ok. You can set the GZIP, to request the server to send its response in gzip compression.
Theres i found, that for some reason some server sends some ILLEGAL GZIP data, that this code cannot uncompress, for some unknown reason (i really have no idea why)
To test the in-compatible response, just set the server to www.cyberciti.biz, leave the url field as empty, and set the GZIP checkbox. The strange thing is, the gzip'ed stuff will work, if you get some SMALLER file from that server, but not the BIG ASS index.html that is the default file. To test, that the server CAN send proper gzip data, just set the URL to "tips/wp-content/themes/nixcraft/style.css" (without the ""-s)
The site I need to download from gets the DATA_ERROR message. Yet, when I hit the same URL with IE or Firefox, it sends gzipped data and they display it properly.
So, I doubt that it's actually illegal data, but more likely something not being handled properly at the receiving or decoding end.
Have you made any progress with this? Success is so close I can taste it.
Well i coulndt get it to work...i get initial data and then <||> 3 o 4 chars like that...and with my http degubber i can see alot of data that has not been processed by vb
i am using
Accept-Encoding: gzip" & vbCrLf
to send the get request...
at data arrival :
wGet.GetData strResponse, vbString, bytesTotal
and still cannot encoded it :S
Last edited by batori; Jan 25th, 2009 at 12:03 PM.