Follow this article
You cannot mock HttpClient, but you can mock the HttpMessageHandler that the HttpClient uses.
To use in unit tests, make sure HttpClient can be injected into the test class, then in tests create an instance of HttpClient with a mocked HttpMessageHandler.