I'm trying to use Refit to replace an existing HttpClient wrapper class that I wrote a while back. Things are working pretty well in most cases, but there is one case where I need to pass a cookie along with my request. Part of my confusion I suppose is that I don't know where exactly a cookie goes when using the HttpClientHandler CookieContainer.
This is the cookie setting code I am trying to mimic:
var handler = new HttpClientHandler();
handler.CookieContainer = new CookieContainer();
handler.CookieContainer.SetCookies(new Uri(endPoint), cookieString);
var httpClient = new HttpClient(handler);
var response = await httpClient.PutAsync(endPoint, jsonContent);
When I step through this code I don't see the cookie being placed in the header, and I struggle to see it anywhere on the request or response headers/values/etc.
How should I mimic this with Refit? I've tried placing it in the header (which works, it goes into the header) but that's not what the CookieContainer seems to do, so it's not working.