Tech Off Post

Single Post Permalink

View Thread: WebRequest and SSL
  • User profile image

    Seems simple enough.

    I thought I knew the answer based on some work with the Application Center Test (ACT) scripting object model which requires creating a secure session before performing requests, but I wanted to check the System.Net object model first before replying.

    What I found sort of surprised me. I haven't tried it myself yet, but thought I would pass this along since it appears that nobody else is offering any aid.

    I found a sample on MSDN that shows an explicit Encoding object passed to the StreamReader. Try this:

    StreamReader sr = new StreamReader (objResponse.GetResponseStream (), System.Text.Encoding.GetEncoding ("utf-8"));