If you read my previous article, it’s easy to become frustrated. HttpClient is at the core of everything we as software developers normally do when we integrate our stuff with other people’s stuff. Somebody sounding the alarm, telling you that it’s fundamentally broken, might result in everything ranging from a general concern about ones own code, to flat out panic attacks. Hence, I figured I’d be an asshole unless I also showed you an alternative.

Paradoxically, fixing HttpClient is very easy, it’s just to cut away everything in it that’s dangerous, and encapsulate everything that’s beautiful about it into a much safer API, making it impossible for developers to retrieve the instance to the HttpClient you’re using internally. Basically, treat most of HttpClient’s API as if it was cancer, and salvage the rest. Here’s a much safer version in case you care. For the record, to understand this class, you have to read my previous article here at DZone.

Source de l’article sur DZONE

L’assistance proposée par ANKAA PMO

ANKAA PMO présent depuis plus de 20 ans sur le marché des services IT, accompagne les DSI dans leur recherche de compétences pour des besoins de renforts en mode régie ou l’externalisation de projets.
Vous souhaitez plus d’information ? Cliquez ici