简体   繁体   English

从网页获取数据时发生C#错误

[英]C# Error while getting data from a web page

Receiving this error: System.Net.WebException: 'The remote server returned an error: (400) Bad Request.' 收到此错误:System.Net.WebException:远程服务器返回错误:(400)错误的请求。 Yet I can still access the data in a web browser. 但是我仍然可以在Web浏览器中访问数据。

WebClient client = new WebClient(); String downloadedString = client.DownloadString("https://api.gdax.com/products/LTC-USD/book/");

Your path is wrong. 您的路线是错误的。 It must be with file name at the end. 它必须以文件名结尾。 See below: 见下文:

https://api.gdax.com/products/LTC-USD/book/index.html or default.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM