This is very cool! And a good move for security and reliability!
It's really not a good idea to have Foundation, with its own URL type and parser, delegating requests to cURL (which also has its own URL parser). It means that an application could use Foundation's URL types to attempt to sanitise a request - maybe checking the hostname, port, etc. - only to find that cURL sends it somewhere entirely different! Those kinds of issues come up in pretty-much every major programming language, and even though I don't know of any specific examples in Foundation (I've never looked, TBH), it's entirely possible that they exist.
The only way to eliminate these issues is for the application and request code to use the same URL parser. That way, you know the host you connect to will definitely be the same as the one in the .host property from your URL, the path you send will be the .path property, etc. Since AsyncHttpClient uses the Foundation URL parser, we will have those guarantees after this switch.
See A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! for more information about these kinds of bugs and how they can be exploited (that's where the picture is from).
FWIW, Foundation's URL gives the hostname as evil.com for the above example. Assuming cURL hasn't changed their parser, Foundation doesn't even have the option of aligning with other implementations (or the latest standard, which says google.com should be the hostname from that example). After the move to AHC, that could very well change.
Would this also apply to Darwin platforms? From what I've been able to discover, URLSession allows FTP downloads (but not uploads). Is this saying that FTP downloads may no longer be supported (through URLSession) in some future SDK?
FTP almost certainly should go. If it were up to me, I'd support dropping it from Apps built with the latest SDK.
What exactly are the platform requirements for NIO? Is it still possible to implement on less traditional platforms, such as WASI?
Finally, while I know this isn't the goal of the proposal, I think lots of developers would appreciate if there were builds of AHC/NIO with access to some of URLSession's magic behaviour (e.g. background sessions on iOS). New APIs would be ideal, but even binary-only builds of those packages with the additions would be welcome. I'm sure it's been heavily requested and there are good reasons why it hasn't been possible, but maybe it's a good opportunity to take another look at it =)