News for hackers. Stuff that matters.
Re:I Forked Httpx by colejohnson66 on Wednesday March 25, 2026 @09:39AM (#47517220)
The boilerplate of not having sane defaults. .NET is much simpler:

    using HttpClient client = new();
    HttpResponseMessage response = await client.GetAsync("https://...");
    if (response.StatusCode is HttpStatusCode.OK)
    {
        string s = await response.Content.ReadAsStringAsync();
        // ...
    }
Re:I Forked Httpx by lmz on Wednesday March 25, 2026 @09:46AM (#47517307)
That's just an example. It does have defaults: https://docs.oracle.com/en/java/javase/11/docs/api/java.net.... (search for "If this method is not invoked")
Re:I Forked Httpx by pjmlp on Wednesday March 25, 2026 @10:58AM (#47518193)
Yeah, so much simpler,

"Common IHttpClientFactory usage issues"

https://learn.microsoft.com/en-us/dotnet/core/extensions/htt...

"Guidelines for using HttpClient"

https://learn.microsoft.com/en-us/dotnet/fundamentals/networ...

And this doesn't account for all gotchas as per .NET version, than only us old timers remember to cross check.

Re:I Forked Httpx by colejohnson66 on Wednesday March 25, 2026 @12:05PM (#47519283)
I didn't mention IHttpClientFactory - just HttpClient. I will concede that ASP manages to be confusing quite often. As for the latter, guidelines are not requirements anymore than "RTFM" is; You can use HttpClient without reading the guidelines and be just fine.
Re:I Forked Httpx by pjmlp on Wednesday March 25, 2026 @12:12PM (#47519383)
For various outcomes of fine, depending on .NET version, given that not everyone is on very latest.