0

I have a WebClient using which I was reading some webpage from the url. Code was working fine until now. When I debugged the code, all I could see was nothing but special characters or may be encoded contents. That particular url is working fine when I open it in browser. I have tried using HttpClient and other methods but it makes no difference. Please suggest what should I do?

P.S: Every other url is working fine in the code.

var client = new WebClient();
var downloadString = client.DownloadString("http://www.covid.gov.pk");
Baqer Naqvi
  • 6,011
  • 3
  • 50
  • 68
  • Response: \u001f‹\b\0\0\0\0\0\0\u0003í=ÛvÛHrÏñWôp²3R\"ðª‹-KšÈ’<ÖŽlk$z\u001coNŽO\u0013h\u0012m\u0001h\u0018\r\u0090¦w÷œÍ?ä%où€<ä\u001böSö\aò\v©ê\u0006@\\I\u0090–=3gG>Ç$\u0081FUuuuuݺqôÕù˳á›ë\vb‡®sòà\b?ˆC½Éq‹y-¼À¨uò€Àß‘ËBJL›\u0006’…Ç­(\u001c\u001b\u000f[Ù[\u001euÙqkÊÙÌ\u0017AØ\"¦ðBæAÓ\u0019·BûØbSn2CýØ!Üã!§Ž!Mê°ã^\u0005 \u001fØ|&\u0002Kf\0™bÊ­\u001dø\u001d\b\u008f&ŸÄ§w\\†ÔÃ\vp¿÷h'½Tljq&\u0019•l‡Ì\"\u001bnOy\u0010Éônü«ð0±\u0018\ríŠëÜ\u001b33䫸g*$b<æ&ô²H)™±‘ä!k‘ÎÉ\u0003Ýñ¯\fƒœÝÞ<%CqÇ – Baqer Naqvi Apr 05 '20 at 09:05
  • 1
    Is this just https://stackoverflow.com/a/27327208/23354 ? (automatic deflate etc handling) – Marc Gravell Apr 05 '20 at 09:07
  • Thank you @MarcGravell. It did the trick :) – Baqer Naqvi Apr 05 '20 at 09:12
  • 1
    k, closing as dup just to keep things clean, but: glad that we found you an answer quickly! – Marc Gravell Apr 05 '20 at 09:16

0 Answers0