dotnet123123
dotnet123123
CC#
Created by dotnet123123 on 8/8/2023 in #help
❔ .NET background service - use windows OS level proxy
lol. one would think it would be a very trivial thing to query the system wide proxy settings and use them. But, alas, windows has other ideas
8 replies
CC#
Created by dotnet123123 on 7/26/2023 in #help
✅ ✅ C# HttpClient returning 400, but other tools return 200
So, this fixed my issue, but I'm wondering why the .NET HttpClient is seemingly defaulting to an empty agent string in the header, when from what I can tell, most other mainstream libraries/languages put a default value in.
19 replies
CC#
Created by dotnet123123 on 7/26/2023 in #help
✅ ✅ C# HttpClient returning 400, but other tools return 200
Thanks again. I will read those 2 links
19 replies
CC#
Created by dotnet123123 on 7/26/2023 in #help
✅ ✅ C# HttpClient returning 400, but other tools return 200
lol nice. I had been quite stumped for awhile. Don't know if I ever would have solved that naturally on my own. Didn't find anything googling online
19 replies
CC#
Created by dotnet123123 on 7/26/2023 in #help
✅ ✅ C# HttpClient returning 400, but other tools return 200
thank you @canton7 , you're a lifesaver. Can I ask how you figured that out? Did you just happen to know about the weird history that HImmDawg mentioned above?
19 replies
CC#
Created by dotnet123123 on 7/26/2023 in #help
✅ ✅ C# HttpClient returning 400, but other tools return 200
.net 6
19 replies
CC#
Created by dotnet123123 on 7/26/2023 in #help
✅ ✅ C# HttpClient returning 400, but other tools return 200
c#
var client = new HttpClient();
var request = await client.GetAsync("http://www.ericsmithrocks.com");
var code = request.StatusCode;
c#
var client = new HttpClient();
var request = await client.GetAsync("http://www.ericsmithrocks.com");
var code = request.StatusCode;
python
import requests
r = requests.get("http://www.ericsmithrocks.com")
r.status_code
python
import requests
r = requests.get("http://www.ericsmithrocks.com")
r.status_code
19 replies