guim26
Posts: 3
Joined: Sat Nov 16, 2019 8:19 pm

Pi 4 C# App, WebClient.DownloadString not working

Sat Nov 16, 2019 8:55 pm

Hi !!!

I have built a C# app using code-oss that makes API calls to crypto-currency websites.The calls are made to a SSL URL but the Webclient function does not work. Instead it returns source code from the page (which is in chinese so i can't tell what the error is),

This is the code:

WebClient c = new WebClient();
string data = c.DownloadString("https://openapi-v2.kucoin.com/api/v1/timestamp");
Console.WriteLine(data);

Any hints or ideas would be greatly appreciated. :)

Heater
Posts: 13874
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pi 4 C# App, WebClient.DownloadString not working

Mon Nov 18, 2019 10:44 am

I suspect google translate could tell you what the error is.

Heck if you posted it here somebody might tell you what it is.
Memory in C++ is a leaky abstraction .

guim26
Posts: 3
Joined: Sat Nov 16, 2019 8:19 pm

Re: Pi 4 C# App, WebClient.DownloadString not working

Mon Nov 18, 2019 1:16 pm

I've tried google translate and asked a chinese friend of mine and no luck. It seems like gibberish:

ㄱㄯ⼷〲㤱〠㨲〵倠䕍牲牯†㨠匊獹整⹭牁畧敭瑮畏佴剦湡敧硅散瑰潩㩮䤠摮硥眠獡漠瑵漠⁦慲杮⹥䴠獵⁴敢渠湯渭来瑡癩⁥湡⁤敬獳琠慨桴⁥楳敺漠⁦桴⁥潣汬捥楴湯മ倊牡浡瑥牥渠浡㩥椠摮硥਍†愠⁴祓瑳浥吮牨睯效灬牥吮牨睯牁畧敭瑮畏佴剦湡敧硅散瑰潩⡮硅散瑰潩䅮杲浵湥⁴牡畧敭瑮‬硅散瑰潩剮獥畯捲⁥敲潳牵散ഩ †瑡匠獹整⹭潃汬捥楴湯⹳敇敮楲⹣楌瑳ㅠ朮瑥䥟整⡭湉㍴′湩敤⥸਍†愠⁴敎瑷湯潳瑦䨮潳⹮楌煮䨮潃瑮楡敮⹲敇䥴整⡭湉㍴′湩敤⥸椠弯匯捲丯睥潴獮景⹴獊湯䰯湩⽱䍊湯慴湩牥挮㩳楬敮㐠㤵਍†愠⁴敎瑷湯潳瑦䨮潳⹮楌煮䨮牁慲⹹敧彴瑉浥伨橢捥⁴敫⥹椠弯匯捲丯睥潴獮景⹴獊湯䰯湩⽱䅊牲祡挮㩳楬敮㈠ㄴ਍†愠⁴扁潯⹴楖睥潍敤獬匮敨汬楖睥潍敤⹬刼湵畋潣湩慖灭物㹥彤㥟⸸潍敶敎瑸⤨椠㩅停剅体䉜慯屴潂瑡䅜潢瑯噜敩䵷摯汥屳桓汥噬敩䵷摯汥挮㩳楬敮ㄠ〳



The try/catch is coded to add datetime to the error logging and it's not added to the file. This error repeats on every https api get request, no matter which website. I ran a TLS version test on my OS and the websites and we are both running TLS 1.2. Everything ran fine for months before this week. I got this error once or twice which was resolved by rebooting the RPI. I'm now running the PC version of the app now which works fine. I can't find anything about this error or anything similar. I'm really confused..... loll.....

Higgins1904
Posts: 12
Joined: Wed Nov 13, 2019 6:34 pm

Re: Pi 4 C# App, WebClient.DownloadString not working

Wed Nov 20, 2019 4:29 pm

Are you running your C# code at Win 10 IOT at the pi, or is it a .NET Core application running within Linux?

guim26
Posts: 3
Joined: Sat Nov 16, 2019 8:19 pm

Re: Pi 4 C# App, WebClient.DownloadString not working

Tue Nov 26, 2019 7:59 pm

It's running on .net core 2.1 with raspbian

Return to “Other programming languages”