Microsoft Visual Studio Projects DISCUSSION

WebClient gives empty response?

Started by syedzainnasir WebClient gives empty response?
0 replies 248 views 1 participants
Latest activity · 07 Mar 2017

WebClient gives empty response?

syedzainnasir Microsoft Visual Studio Projects Forum
#1
Hello,

I wonder why I get an empty response from the below URL?

When open the URL in chrome, there is a JSON response.
[code]WebClient client = new WebClient(); client.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2"); Stream data = client.OpenRead("https://api.coinsecure.in/v1/exchange/ticker"); StreamReader reader = new StreamReader(data); String responseBody = reader.ReadToEnd(); data.Close(); reader.Close(); MessageBox.Show(responseBody);[/code]

Community replies 0

Be the first to help

There are no replies yet.

TEP COMMUNITY