[{"data":1,"prerenderedAt":1055},["ShallowReactive",2],{"i-feather:search":3,"i-feather:x":8,"i-feather:moon":10,"i-feather:sun":12,"i-fa-brands:youtube":14,"i-fa-brands:twitch":18,"i-fa-brands:github":20,"i-fa-brands:linkedin":23,"i-fa-brands:stack-overflow":26,"i-simple-icons:bluesky":29,"i-fa-brands:mastodon":31,"i-fa-regular:envelope":33,"i-fa-solid:rss":35,"post-\u002Foptimally-configuring-asp-net-core-httpclientfactory\u002F":37,"post-navigation":654,"i-fa-solid:share-alt":1035,"i-fa-brands:facebook":1037,"i-fa-brands:twitter":1039,"i-fa-brands:reddit":1041,"i-fa-brands:patreon":1043,"i-simple-icons:buymeacoffee":1045,"i-fa-brands:paypal":1047,"i-fa-regular:question-circle":1049,"i-feather:arrow-left":1051,"i-feather:arrow-right":1053},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"11\" cy=\"11\" r=\"8\"\u002F>\u003Cpath d=\"m21 21l-4.35-4.35\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M18 6L6 18M6 6l12 12\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"5\"\u002F>\u003Cpath d=\"M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72l1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":15,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":17},576,512,"\u003Cpath fill=\"currentColor\" d=\"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597c-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821c11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305m-317.51 213.508V175.185l142.739 81.205z\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":19},"\u003Cpath fill=\"currentColor\" d=\"M391.17 103.47h-38.63v109.7h38.63ZM285 103h-38.63v109.75H285ZM120.83 0L24.31 91.42v329.16h115.83V512l96.53-91.42h77.25L487.69 256V0Zm328.24 237.75l-77.22 73.12h-77.24l-67.6 64v-64h-86.87V36.58h308.93Z\"\u002F>",{"left":4,"top":4,"width":21,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":22},496,"\u003Cpath fill=\"currentColor\" d=\"M165.9 397.4c0 2-2.3 3.6-5.2 3.6c-3.3.3-5.6-1.3-5.6-3.6c0-2 2.3-3.6 5.2-3.6c3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9c2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9c.3 2 2.9 3.3 5.9 2.6c2.9-.7 4.9-2.6 4.6-4.6c-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2c12.8 2.3 17.3-5.6 17.3-12.1c0-6.2-.3-40.4-.3-61.4c0 0-70 15-84.7-29.8c0 0-11.4-29.1-27.8-36.6c0 0-22.9-15.7 1.6-15.4c0 0 24.9 2 38.6 25.8c21.9 38.6 58.6 27.5 72.9 20.9c2.3-16 8.8-27.1 16-33.7c-55.9-6.2-112.3-14.3-112.3-110.5c0-27.5 7.6-41.3 23.6-58.9c-2.6-6.5-11.1-33.3 2.6-67.9c20.9-6.5 69 27 69 27c20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27c13.7 34.7 5.2 61.4 2.6 67.9c16 17.7 25.8 31.5 25.8 58.9c0 96.5-58.9 104.2-114.8 110.5c9.2 7.9 17 22.9 17 46.4c0 33.7-.3 75.4-.3 83.6c0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252C496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2c1.6 1.6 3.9 2.3 5.2 1c1.3-1 1-3.3-.7-5.2c-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9c1.6 1 3.6.7 4.3-.7c.7-1.3-.3-2.9-2.3-3.9c-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2c2.3 2.3 5.2 2.6 6.5 1c1.3-1.3.7-4.3-1.3-6.2c-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2c-1.4-2.3-4-3.3-5.6-2\"\u002F>",{"left":4,"top":4,"width":24,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":25},448,"\u003Cpath fill=\"currentColor\" d=\"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3M135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5c0 21.3-17.2 38.5-38.5 38.5m282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7c-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5c67.2 0 79.7 44.3 79.7 101.9z\"\u002F>",{"left":4,"top":4,"width":27,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":28},384,"\u003Cpath fill=\"currentColor\" d=\"M290.7 311L95 269.7L86.8 309l195.7 41zm51-87L188.2 95.7l-25.5 30.8l153.5 128.3zm-31.2 39.7L129.2 179l-16.7 36.5L293.7 300zM262 32l-32 24l119.3 160.3l32-24zm20.5 328h-200v39.7h200zm39.7 80H42.7V320h-40v160h359.5V320h-40z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":30},"\u003Cpath fill=\"currentColor\" d=\"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037c-.856 3.061-3.978 3.842-6.755 3.37c4.854.826 6.089 3.562 3.422 6.299c-5.065 5.196-7.28-1.304-7.847-2.97c-.104-.305-.152-.448-.153-.327c0-.121-.05.022-.153.327c-.568 1.666-2.782 8.166-7.847 2.97c-2.667-2.737-1.432-5.473 3.422-6.3c-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026\"\u002F>",{"left":4,"top":4,"width":24,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":32},"\u003Cpath fill=\"currentColor\" d=\"M433 179.11c0-97.2-63.71-125.7-63.71-125.7c-62.52-28.7-228.56-28.4-290.48 0c0 0-63.72 28.5-63.72 125.7c0 115.7-6.6 259.4 105.63 289.1c40.51 10.7 75.32 13 103.33 11.4c50.81-2.8 79.32-18.1 79.32-18.1l-1.7-36.9s-36.31 11.4-77.12 10.1c-40.41-1.4-83-4.4-89.63-54a102.5 102.5 0 0 1-.9-13.9c85.63 20.9 158.65 9.1 178.75 6.7c56.12-6.7 105-41.3 111.23-72.9c9.8-49.8 9-121.5 9-121.5m-75.12 125.2h-46.63v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.33V197c0-58.5-64-56.6-64-6.9v114.2H90.19c0-122.1-5.2-147.9 18.41-175c25.9-28.9 79.82-30.8 103.83 6.1l11.6 19.5l11.6-19.5c24.11-37.1 78.12-34.8 103.83-6.1c23.71 27.3 18.4 53 18.4 175z\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":34},"\u003Cpath fill=\"currentColor\" d=\"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48m0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49c-16.841 13.247-50.201 45.072-73.413 44.701c-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646c21.857 17.205 60.134 55.186 103.062 54.955c42.717.231 80.509-37.199 103.053-54.947c49.528-38.783 82.032-64.401 104.947-82.653V400z\"\u002F>",{"left":4,"top":4,"width":24,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":36},"\u003Cpath fill=\"currentColor\" d=\"M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041s64.04 28.673 64.04 64.041m175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018c111.832 7.284 201.473 96.702 208.772 208.772c.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79m144.249.288C439.596 229.677 251.465 40.445 16.503 32.01C7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999c191.179 7.839 344.627 161.316 352.465 352.465c.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504\"\u002F>",{"id":38,"title":39,"author":40,"body":41,"comments":533,"date":631,"dateModified":632,"description":633,"extension":634,"headings":635,"heroImage":644,"meta":645,"path":646,"permalink":646,"published":647,"stem":648,"tags":649,"timeToRead":653},"posts\u002Fposts\u002F2018\u002Foptimally-configuring-asp-net-core-httpclientfactory\u002Findex.md","Optimally Configuring ASP.NET Core HttpClientFactory","Muhammad Rehan Saeed",{"type":42,"value":43,"toc":530},"minimark",[44,59,90,115,172,197,203,210,237,240,245,248,255,258,261,264,269,280,302,305,322,343,354,385,398,401,411,420,423,426,436,442,461,464,467,472,483,500,511,520,526],[45,46,50,56],"div",{"className":47},[48,49],"custom-block","warning",[51,52,55],"p",{"className":53},[54],"custom-block-title","Update (04 April 2021)",[51,57,58],{},"Updated all code for .NET 5 and mentioned Open Telemetry.",[45,60,62,66],{"className":61},[48,49],[51,63,65],{"className":64},[54],"Update (20 August 2018)",[51,67,68,78,79,84,85,89],{},[69,70,77],"a",{"href":71,"rel":72,"target":76},"https:\u002F\u002Fwww.stevejgordon.co.uk\u002F",[73,74,75],"nofollow","noopener","noreferrer","_blank","Steve Gordon"," kindly suggested a ",[69,80,83],{"href":81,"rel":82,"target":76},"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002FHttpClientSample\u002Fpull\u002F1",[73,74,75],"further optimisation"," to use ",[86,87,88],"code",{},"ConfigureHttpClient",". I've updated the code below to reflect this.",[51,91,92,93,96,97,102,103,108,109,114],{},"In this post, I'm going to show how to optimally configure a ",[86,94,95],{},"HttpClient"," using the new ",[69,98,101],{"href":99,"rel":100,"target":76},"https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Faspnet\u002Fcore\u002Ffundamentals\u002Fhttp-requests?view=aspnetcore-2.1",[73,74,75],"HttpClientFactory"," API in ASP.NET Core 2.1. If you haven't already I recommend reading Steve Gordon's ",[69,104,107],{"href":105,"rel":106,"target":76},"https:\u002F\u002Fwww.stevejgordon.co.uk\u002Fintroduction-to-httpclientfactory-aspnetcore",[73,74,75],"series of blog posts"," on the subject since this post builds on that knowledge. You should also read his post about ",[69,110,113],{"href":111,"rel":112,"target":76},"https:\u002F\u002Fwww.stevejgordon.co.uk\u002Fasp-net-core-correlation-ids",[73,74,75],"Correlation ID's"," as I'm making use of that library in this post. The main aims of the code in this post are to:",[116,117,118,125,131,137,142,147,154,163],"ol",{},[119,120,121,122,124],"li",{},"Use the ",[86,123,101],{}," typed client, I don't know why the ASP.NET team bothered to provide three ways to register a client, the typed client is the one to use. It provides type safety and removes the need for magic strings.",[119,126,127,128,130],{},"Enable GZIP decompression of responses for better performance. Interestingly, the ",[86,129,95],{}," and ASP.NET Core does not support compression of GZIP requests, only responses. Doing some searching online some time ago suggests that this is an optimisation that is not very common at all, I thought this was pretty unbelievable at the time.",[119,132,133,134,136],{},"The ",[86,135,95],{}," should time out after the server does not respond after a set amount of time.",[119,138,133,139,141],{},[86,140,95],{}," should retry requests which fail due to transient errors.",[119,143,133,144,146],{},[86,145,95],{}," should stop performing new requests for a period of time when a consecutive number of requests fail using the circuit breaker pattern. Failing fast in this way helps to protect an API or database that may be under high load and means the client gets a failed response quickly rather than waiting for a time-out.",[119,148,149,150,153],{},"The URL, time-out, retry and circuit breaker settings should be configurable from the ",[86,151,152],{},"appsettings.json"," file.",[119,155,133,156,158,159,162],{},[86,157,95],{}," should send a ",[86,160,161],{},"User-Agent"," HTTP header telling the server the name and version of the calling application. If the server is logging this information, this can be useful for debugging purposes.",[119,164,133,165,168,169,171],{},[86,166,167],{},"X-Correlation-ID"," HTTP header from the response should be passed on to the request made using the ",[86,170,95],{},". This would make it easy to correlate a request across multiple applications.",[173,174,176,196],"h1",{"id":175},"usage-example",[177,178,181],"anchor-link",{"href":179,"label":180},"#usage-example","Link to this section",[182,183,190],"svg",{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink","0 0 16 16","1.1",22,"true",[191,192],"path",{"fill":193,"fill-rule":194,"d":195},"currentColor","evenodd","M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z","Usage Example",[51,198,199,200,202],{},"It doesn't really matter what the typed client ",[86,201,95],{}," looks like, that's not what we're talking about but I include it for context.",[204,205],"pre",{"className":206,"language":207,"meta":208,"style":208,"html":209},"language-cs shiki shiki-themes light-plus monokai","cs","","\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> interface\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> IRocketClient\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">    Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TakeoffStatus\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetStatus\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">bool\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> working\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> RocketClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"sw29p\">IRocketClient\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> readonly\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> HttpClient\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> RocketClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sw29p\">HttpClient\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\u003C\u002Fspan>\u003Cspan class=\"sK46n\"> this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">httpClient\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> async\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TakeoffStatus\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetStatus\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">bool\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> working\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s4J9F\">        var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> response\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> await\u003C\u002Fspan>\u003Cspan class=\"sK46n\"> this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">working\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> ?\u003C\u002Fspan>\u003Cspan class=\"swiDo\"> \"status-working\"\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> :\u003C\u002Fspan>\u003Cspan class=\"swiDo\"> \"status-failing\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        response\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">EnsureSuccessStatusCode\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">();\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        return\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> await\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> response\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Content\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ReadFromJsonAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TakeoffStatus\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;();\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[51,211,212,213,216,217,220,221,224,225,230,231,233,234,236],{},"Here is how we register the typed client above with our dependency injection container. All of the meat lives in these three methods. ",[86,214,215],{},"AddCorrelationId"," adds a middleware written by Steve Gordon to handle ",[69,218,113],{"href":111,"rel":219,"target":76},[73,74,75],". ",[86,222,223],{},"AddPolicies"," registers a policy registry and the policies themselves (A policy is ",[69,226,229],{"href":227,"rel":228,"target":76},"https:\u002F\u002Fgithub.com\u002FApp-vNext\u002FPolly",[73,74,75],"Polly's"," way of specifying how you want to deal with errors e.g. using retries, circuit breaker pattern etc.). Finally, we add the typed ",[86,232,95],{}," but with configuration options, so we can configure it's settings from ",[86,235,152],{},".",[204,238],{"className":206,"language":207,"meta":208,"style":208,"html":239},"\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> virtual\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> void\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> ConfigureServices\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sw29p\">IServiceCollection\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">    services\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddDefaultCorrelationId\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">() \u003C\u002Fspan>\u003Cspan class=\"s1q82\">\u002F\u002F Add Correlation ID support to ASP.NET Core\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddControllers\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        .\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Services\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddPolicies\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"s1q82\">\u002F\u002F Setup Polly policies.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddHttpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">IRocketClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sw29p\">RocketClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sw29p\">RocketClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;(\u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"swiDo\">\"RocketClient\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"snCLD\">        ..\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.;\n\u003C\u002Fspan>\u003C\u002Fspan>",[51,241,133,242,244],{},[86,243,152],{}," file below contains the base address for the endpoint we want to connect to, a time-out value of thirty seconds is used if the server is taking too long to respond and policy settings for retries and the circuit breaker.",[51,246,247],{},"The retry settings state that after a first failed request, another three attempts will be made (this means you can get up to four requests). There will be an exponentially longer back-off or delay between each request. The first retry request will occur after two seconds, the second after another four seconds and the third occurs after another eight seconds.",[51,249,250,251,254],{},"The circuit breaker states that it will allow 12 consecutive failed requests before breaking the circuit and throwing ",[86,252,253],{},"CircuitBrokenException"," for every attempted request. The circuit will be broken for thirty seconds.",[51,256,257],{},"Generally, my advice is when allowing a high number of exceptions before breaking, use a longer duration of break. When allowing a lower number of exceptions before breaking, keep the duration of break small.",[51,259,260],{},"Another possibility I've not tried is to combine these two scenarios, so you have two circuit breakers. The circuit breaker with the lower limit would kick in first but only break the circuit for a short time, if exceptions are no longer thrown, then things go back to normal quickly. If exceptions continue to be thrown, then the other circuit breaker with a longer duration of break would kick in and the circuit would be broken for a longer period of time. I leave implementing this particular scenario to the reader.",[51,262,263],{},"You can of course play with these numbers, what you set them to will depend on your application.",[204,265],{"className":266,"language":267,"meta":208,"style":208,"html":268},"language-json shiki shiki-themes light-plus monokai","json","\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"RocketClient\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">        \"BaseAddress\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"http:\u002F\u002Fexample.com\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">        \"Timeout\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"00:00:30\"\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    },\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">    \"Policies\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">        \"HttpCircuitBreaker\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">            \"DurationOfBreak\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"syaXe\">\"00:00:30\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">            \"ExceptionsAllowedBeforeBreaking\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">12\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        },\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">        \"HttpRetry\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">            \"BackoffPower\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">2\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"svrZB\">            \"Count\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"s0PsH\">3\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[173,270,272,279],{"id":271},"configuring-polly-policies",[177,273,275],{"href":274,"label":180},"#configuring-polly-policies",[182,276,277],{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},[191,278],{"fill":193,"fill-rule":194,"d":195},"Configuring Polly Policies",[51,281,282,283,286,287,289,290,293,294,299,300,236],{},"Below is the implementation for ",[86,284,285],{},"AddPollyPolicies",". It starts by setting up and reading a configuration section in our ",[86,288,152],{}," file of type ",[86,291,292],{},"PolicyOptions",". Then adds the ",[69,295,298],{"href":296,"rel":297,"target":76},"https:\u002F\u002Fgithub.com\u002FApp-vNext\u002FPolly\u002Fwiki\u002FPolicyRegistry",[73,74,75],"PolicyRegistry"," which is where Polly stores it's policies. Finally, we add a retry and circuit breaker policy and configure them using the settings we've read from the ",[86,301,292],{},[204,303],{"className":206,"language":207,"meta":208,"style":208,"html":304},"\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ServiceCollectionExtensions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> const\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> PoliciesConfigurationSectionName\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"swiDo\"> \"Policies\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> IServiceCollection\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> AddPolicies\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        this\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> IServiceCollection\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        IConfiguration\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> configurationSectionName\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> PoliciesConfigurationSectionName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Configure\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">PolicyOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s4J9F\">        var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> policyOptions\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetSection\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">configurationSectionName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">).\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">PolicyOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;();\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s4J9F\">        var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> policyRegistry\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddPolicyRegistry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">();\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        policyRegistry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Add\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">            PolicyName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpRetry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">            HttpPolicyExtensions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">HandleTransientHttpError\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">WaitAndRetryAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                    policyOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpRetry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Count\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                    retryAttempt\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =&gt;\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> TimeSpan\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">FromSeconds\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Math\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Pow\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">policyOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpRetry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">BackoffPower\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">retryAttempt\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">))));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        policyRegistry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Add\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">            PolicyName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">            HttpPolicyExtensions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">HandleTransientHttpError\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">CircuitBreakerAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                    handledEventsAllowedBeforeBreaking\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">policyOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">ExceptionsAllowedBeforeBreaking\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                    durationOfBreak\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">: \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">policyOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">DurationOfBreak\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        return\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> PolicyName\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> const\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> nameof\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> const\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> HttpRetry\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> nameof\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpRetry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> PolicyOptions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> CircuitBreakerPolicyOptions\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> RetryPolicyOptions\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> HttpRetry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> CircuitBreakerPolicyOptions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> TimeSpan\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> DurationOfBreak\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; } \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> TimeSpan\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">FromSeconds\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"s0PsH\">30\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> int\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> ExceptionsAllowedBeforeBreaking\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; } \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=\u003C\u002Fspan>\u003Cspan class=\"s0PsH\"> 12\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> RetryPolicyOptions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> int\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Count\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; } \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=\u003C\u002Fspan>\u003Cspan class=\"s0PsH\"> 3\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> int\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> BackoffPower\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; } \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=\u003C\u002Fspan>\u003Cspan class=\"s0PsH\"> 2\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[51,306,307,308,311,312,317,318,321],{},"Notice that each policy is using the ",[86,309,310],{},"HandleTransientHttpError"," method which tells Polly when to apply the retry and circuit breakers. One important question is, what is a transient HTTP error according to Polly? Well, looking at the ",[69,313,316],{"href":314,"rel":315,"target":76},"https:\u002F\u002Fgithub.com\u002FApp-vNext\u002FPolly.Extensions.Http\u002Fblob\u002F808665304882fb921b1c38cbbd38fcc102229f84\u002Fsrc\u002FPolly.Extensions.Http.Shared\u002FHttpPolicyExtensions.cs",[73,74,75],"source code"," in the ",[86,319,320],{},"Polly.Extensions.Http"," GitHub repository, it looks like they consider any of the below as transient errors:",[116,323,324,331,337],{},[119,325,326,327,330],{},"Any ",[86,328,329],{},"HttpRequestException"," thrown. This can happen when the server is down.",[119,332,333,334,236],{},"A response with a status code of ",[86,335,336],{},"408 Request Timeout",[119,338,333,339,342],{},[86,340,341],{},"500 Internal Server Error"," or above.",[173,344,346,353],{"id":345},"configuring-httpclient",[177,347,349],{"href":348,"label":180},"#configuring-httpclient",[182,350,351],{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},[191,352],{"fill":193,"fill-rule":194,"d":195},"Configuring HttpClient",[51,355,356,357,359,360,363,364,367,368,220,370,372,373,376,377,380,381,384],{},"Finally, we can get down to configuring our ",[86,358,95],{}," itself. The ",[86,361,362],{},"AddHttpClient"," method starts by binding the ",[86,365,366],{},"TClientOptions"," type to a configuration section in ",[86,369,152],{},[86,371,366],{}," is a derived type of ",[86,374,375],{},"HttpClientOptions"," which just contains a base address and time-out value. I'll come back to ",[86,378,379],{},"CorrelationIdDelegatingHandler"," and ",[86,382,383],{},"UserAgentDelegatingHandler"," in a moment.",[51,386,387,388,391,392,395,396,236],{},"We set the ",[86,389,390],{},"HttpClientHandler"," to be ",[86,393,394],{},"DefaultHttpClientHandler",". This type just enables Brotli, GZIP and Deflate compression. Finally, we add the retry and circuit breaker policies to the ",[86,397,95],{},[204,399],{"className":206,"language":207,"meta":208,"style":208,"html":400},"\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ServiceCollectionExtensions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> IServiceCollection\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> AddHttpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sw29p\">TImplementation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sw29p\">TClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        this\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> IServiceCollection\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        IConfiguration\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> configurationSectionName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        where\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> TClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">class\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        where\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> TImplementation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">class\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sw29p\">TClient\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">        where\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> TClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"sw29p\">HttpClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sJvqV\">new\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">() \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        services\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Configure\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">configuration\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetSection\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">configurationSectionName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">))\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddSingleton\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">CorrelationIdDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddSingleton\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddHttpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sw29p\">TImplementation\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigureHttpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                (\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">serviceProvider\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s4J9F\">                    var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> httpClientOptions\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> serviceProvider\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                        .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetRequiredService\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">IOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">TClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                        .\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Value\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                    httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">BaseAddress\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> httpClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">BaseAddress\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                    httpClient\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Timeout\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> httpClientOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Timeout\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">                })\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">ConfigurePrimaryHttpMessageHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">x\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =&gt;\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> DefaultHttpClientHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">())\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddPolicyHandlerFromRegistry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">PolicyName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpRetry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddPolicyHandlerFromRegistry\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">PolicyName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">HttpCircuitBreaker\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddHttpMessageHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">CorrelationIdDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">AddHttpMessageHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            .\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Services\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> DefaultHttpClientHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"sw29p\">HttpClientHandler\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> DefaultHttpClientHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">() \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\u003C\u002Fspan>\u003Cspan class=\"sK46n\"> this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">AutomaticDecompression\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        DecompressionMethods\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Brotli\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> |\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        DecompressionMethods\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Deflate\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> |\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        DecompressionMethods\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">GZip\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> HttpClientOptions\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> Uri\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> BaseAddress\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> TimeSpan\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> Timeout\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[173,402,404,379],{"id":403},"correlationiddelegatinghandler",[177,405,407],{"href":406,"label":180},"#correlationiddelegatinghandler",[182,408,409],{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},[191,410],{"fill":193,"fill-rule":194,"d":195},[51,412,413,414,416,417,419],{},"When I'm making a HTTP request from an API i.e. it's an API to API call and I control both sides, I use the ",[86,415,167],{}," HTTP header to trace requests as they move down the stack. The ",[86,418,379],{}," is used to take the correlation ID for the current HTTP request and pass it down to the request made in the API to API call. The implementation is pretty simple, it's just setting a HTTP header.",[51,421,422],{},"The power comes when you are using something like Application Insights, Kibana or Seq for logging. You can now take the correlation ID for a request and see the logs for it from multiple API's or services. This is really invaluable when you are dealing with a micro services architecture.",[204,424],{"className":206,"language":207,"meta":208,"style":208,"html":425},"\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> CorrelationIdDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"sw29p\">DelegatingHandler\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> readonly\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ICorrelationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> correlationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> readonly\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> IOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">CorrelationIdOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">options\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> CorrelationIdDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        ICorrelationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> correlationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        IOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">CorrelationIdOptions\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">options\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sK46n\">        this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">correlationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> correlationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sK46n\">        this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">options\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> options\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    protected\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> override\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">HttpResponseMessage\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sWm5y\">SendAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        HttpRequestMessage\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        CancellationToken\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> cancellationToken\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        if\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"snCLD\">!\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Headers\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Contains\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">options\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Value\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">RequestHeader\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">))\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">            request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Headers\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Add\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">options\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Value\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">RequestHeader\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">correlationContextAccessor\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">CorrelationContext\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">CorrelationId\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">        \u002F\u002F Else the header has already been added due to a retry.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        return\u003C\u002Fspan>\u003Cspan class=\"sK46n\"> base\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">SendAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">cancellationToken\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[173,427,429,383],{"id":428},"useragentdelegatinghandler",[177,430,432],{"href":431,"label":180},"#useragentdelegatinghandler",[182,433,434],{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},[191,435],{"fill":193,"fill-rule":194,"d":195},[51,437,438,439,441],{},"It's often useful to know something about the client that is calling your API for logging and debugging purposes. You can use the ",[86,440,161],{}," HTTP header for this purpose.",[51,443,133,444,446,447,449,450,380,453,456,457,460],{},[86,445,383],{}," just sets the ",[86,448,161],{}," HTTP header by taking the API's assembly name and version attributes. You need to set the ",[86,451,452],{},"Version",[86,454,455],{},"Product"," attributes in your ",[86,458,459],{},"csproj"," file for this to work. The name and version are then placed along with the current operating system into the User-Agent string.",[51,462,463],{},"Now the next time you get an error in your API, you'll know the client application that caused it (if it's under your control).",[204,465],{"className":206,"language":207,"meta":208,"style":208,"html":466},"\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">public\u003C\u002Fspan>\u003Cspan class=\"s4J9F\"> class\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> : \u003C\u002Fspan>\u003Cspan class=\"sw29p\">DelegatingHandler\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">{\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        : \u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetEntryAssembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">())\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sw29p\">Assembly\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        : \u003C\u002Fspan>\u003Cspan class=\"sK46n\">this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetProduct\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">), \u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetVersion\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">))\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> applicationName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sJvqV\">string\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> applicationVersion\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        if\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">applicationName\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> ==\u003C\u002Fspan>\u003Cspan class=\"sMc8R\"> null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">            throw\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ArgumentNullException\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">nameof\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">applicationName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        if\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">applicationVersion\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> ==\u003C\u002Fspan>\u003Cspan class=\"sMc8R\"> null\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">            throw\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ArgumentNullException\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">nameof\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">applicationVersion\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sK46n\">        this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">UserAgentValues\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> List\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">ProductInfoHeaderValue\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;()\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">            new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ProductInfoHeaderValue\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">applicationName\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Replace\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">' '\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"swiDo\">'-'\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">), \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">applicationVersion\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">),\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">            new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ProductInfoHeaderValue\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"swiDo\">$\"(\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">{\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Environment\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">OSVersion\u003C\u002Fspan>\u003Cspan class=\"sfK3G\">}\u003C\u002Fspan>\u003Cspan class=\"swiDo\">)\"\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">),\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        };\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> UserAgentDelegatingHandler\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sw29p\">List\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">ProductInfoHeaderValue\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">userAgentValues\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sK46n\">        this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">UserAgentValues\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> =\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> userAgentValues\u003C\u002Fspan>\u003Cspan class=\"snCLD\"> ??\u003C\u002Fspan>\u003Cspan class=\"smL5M\"> throw\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> new\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> ArgumentNullException\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sJvqV\">nameof\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">userAgentValues\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">));\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    public\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> List\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">ProductInfoHeaderValue\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">UserAgentValues\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> { \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">get\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; \u003C\u002Fspan>\u003Cspan class=\"s4J9F\">set\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">; }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    protected\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> override\u003C\u002Fspan>\u003Cspan class=\"sw29p\"> Task\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">HttpResponseMessage\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt; \u003C\u002Fspan>\u003Cspan class=\"sWm5y\">SendAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        HttpRequestMessage\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">,\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sw29p\">        CancellationToken\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> cancellationToken\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        if\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"snCLD\">!\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Headers\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">UserAgent\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Any\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">())\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">            foreach\u003C\u002Fspan>\u003Cspan class=\"sjLUg\"> (\u003C\u002Fspan>\u003Cspan class=\"s4J9F\">var\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> userAgentValue\u003C\u002Fspan>\u003Cspan class=\"smL5M\"> in\u003C\u002Fspan>\u003Cspan class=\"sK46n\"> this\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">UserAgentValues\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">)\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            {\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">                request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Headers\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">UserAgent\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">Add\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">userAgentValue\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">            }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">        }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">        \u002F\u002F Else the header has already been added due to a retry.\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"smL5M\">        return\u003C\u002Fspan>\u003Cspan class=\"sK46n\"> base\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">SendAsync\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">request\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">, \u003C\u002Fspan>\u003Cspan class=\"sFrd5\">cancellationToken\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">);\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">    }\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> string\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> GetProduct\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sw29p\">Assembly\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetCustomAttribute\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">AssemblyProductAttribute\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;().\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Product\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sJvqV\">    private\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> static\u003C\u002Fspan>\u003Cspan class=\"sJvqV\"> string\u003C\u002Fspan>\u003Cspan class=\"sWm5y\"> GetVersion\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">(\u003C\u002Fspan>\u003Cspan class=\"sw29p\">Assembly\u003C\u002Fspan>\u003Cspan class=\"sFrd5\"> assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">) \u003C\u002Fspan>\u003Cspan class=\"snCLD\">=&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sFrd5\">        assembly\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">.\u003C\u002Fspan>\u003Cspan class=\"sWm5y\">GetCustomAttribute\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sw29p\">AssemblyFileVersionAttribute\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">&gt;().\u003C\u002Fspan>\u003Cspan class=\"sFrd5\">Version\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sjLUg\">}\n\u003C\u002Fspan>\u003C\u002Fspan>",[204,468],{"className":469,"language":470,"meta":208,"style":208,"html":471},"language-xml shiki shiki-themes light-plus monokai","xml","\u003Cspan class=\"line\">\u003Cspan class=\"sNflI\">&lt;\u003C\u002Fspan>\u003Cspan class=\"sjbfc\">PropertyGroup\u003C\u002Fspan>\u003Cspan class=\"snDo4\"> Label\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">=\u003C\u002Fspan>\u003Cspan class=\"squEy\">\"Package\"\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sNflI\">  &lt;\u003C\u002Fspan>\u003Cspan class=\"sjbfc\">Version\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&gt;\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">1.0.0\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&lt;\u002F\u003C\u002Fspan>\u003Cspan class=\"sjbfc\">Version\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sNflI\">  &lt;\u003C\u002Fspan>\u003Cspan class=\"sjbfc\">Product\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&gt;\u003C\u002Fspan>\u003Cspan class=\"sjLUg\">My Application\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&lt;\u002F\u003C\u002Fspan>\u003Cspan class=\"sjbfc\">Product\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"s1q82\">  &lt;!-- ... --&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan class=\"sNflI\">&lt;\u002F\u003C\u002Fspan>\u003Cspan class=\"sjbfc\">PropertyGroup\u003C\u002Fspan>\u003Cspan class=\"sNflI\">&gt;\n\u003C\u002Fspan>\u003C\u002Fspan>",[173,473,475,482],{"id":474},"open-telemetry",[177,476,478],{"href":477,"label":180},"#open-telemetry",[182,479,480],{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},[191,481],{"fill":193,"fill-rule":194,"d":195},"Open Telemetry",[51,484,485,486,380,488,490,491,495,496,499],{},"Setting the ",[86,487,167],{},[86,489,161],{}," HTTP headers are useful things to do but there is a new set of HTTP headers which come under the Open Telemetry standard which not only replace them but also add additional functionality. You can read more about ",[69,492,482],{"href":493,"rel":494,"target":76},"https:\u002F\u002Frehansaeed.com\u002Fdeep-dive-into-open-telemetry-for-net\u002F",[73,74,75]," in my ",[69,497,107],{"href":493,"rel":498,"target":76},[73,74,75]," on the subject.",[173,501,503,510],{"id":502},"sample-github-project",[177,504,506],{"href":505,"label":180},"#sample-github-project",[182,507,508],{"xmlns":184,"xmlns:xlink":185,"viewBox":186,"version":187,"width":188,"height":188,"aria-hidden":189},[191,509],{"fill":193,"fill-rule":194,"d":195},"Sample GitHub Project",[51,512,513,514,519],{},"I realize that was a lot of boilerplate code to write. It was difficult to write this as more than one blog post. To aid in digestion, I've created a ",[69,515,518],{"href":516,"rel":517,"target":76},"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002FHttpClientSample",[73,74,75],"GitHub sample project"," with the full working code.",[51,521,522,523,525],{},"The sample project contains two API's. One makes a HTTP request to the other. You can pass a query argument to decide whether the callee API will fail or not and try out the retry and circuit breaker logic. Feel free to play with the configuration in ",[86,524,152],{}," and see what options work best for your application.",[527,528,529],"style",{},"html pre.shiki code .sJvqV, html code.shiki .sJvqV{--shiki-default:#0000FF;--shiki-dark:#F92672}html pre.shiki code .s4J9F, html code.shiki .s4J9F{--shiki-default:#0000FF;--shiki-default-font-style:inherit;--shiki-dark:#66D9EF;--shiki-dark-font-style:italic}html pre.shiki code .sw29p, html code.shiki .sw29p{--shiki-default:#267F99;--shiki-default-text-decoration:inherit;--shiki-dark:#A6E22E;--shiki-dark-text-decoration:underline}html pre.shiki code .sjLUg, html code.shiki .sjLUg{--shiki-default:#000000;--shiki-dark:#F8F8F2}html pre.shiki code .sWm5y, html code.shiki .sWm5y{--shiki-default:#795E26;--shiki-dark:#A6E22E}html pre.shiki code .sFrd5, html code.shiki .sFrd5{--shiki-default:#001080;--shiki-dark:#F8F8F2}html pre.shiki code .snCLD, html code.shiki .snCLD{--shiki-default:#000000;--shiki-dark:#F92672}html pre.shiki code .sK46n, html code.shiki .sK46n{--shiki-default:#0000FF;--shiki-dark:#FD971F}html pre.shiki code .swiDo, html code.shiki .swiDo{--shiki-default:#A31515;--shiki-dark:#E6DB74}html pre.shiki code .smL5M, html code.shiki .smL5M{--shiki-default:#AF00DB;--shiki-dark:#F92672}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s1q82, html code.shiki .s1q82{--shiki-default:#008000;--shiki-dark:#88846F}html pre.shiki code .svrZB, html code.shiki .svrZB{--shiki-default:#0451A5;--shiki-default-font-style:inherit;--shiki-dark:#66D9EF;--shiki-dark-font-style:italic}html pre.shiki code .syaXe, html code.shiki .syaXe{--shiki-default:#A31515;--shiki-dark:#CFCFC2}html pre.shiki code .s0PsH, html code.shiki .s0PsH{--shiki-default:#098658;--shiki-dark:#AE81FF}html pre.shiki code .sMc8R, html code.shiki .sMc8R{--shiki-default:#0000FF;--shiki-dark:#AE81FF}html pre.shiki code .sfK3G, html code.shiki .sfK3G{--shiki-default:#000000FF;--shiki-dark:#F8F8F2}html pre.shiki code .sNflI, html code.shiki .sNflI{--shiki-default:#800000;--shiki-dark:#F8F8F2}html pre.shiki code .sjbfc, html code.shiki .sjbfc{--shiki-default:#800000;--shiki-dark:#F92672}html pre.shiki code .snDo4, html code.shiki .snDo4{--shiki-default:#E50000;--shiki-dark:#A6E22E}html pre.shiki code .squEy, html code.shiki .squEy{--shiki-default:#0000FF;--shiki-dark:#E6DB74}",{"title":208,"searchDepth":531,"depth":531,"links":532},2,[],{"issue":534,"comments":538},{"number":535,"title":536,"html_url":537},99,"[Comment] Optimally Configuring ASP.NET Core HttpClientFactory","https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99",[539,551,559,567,575,583,591,599,607,615,623],{"id":540,"html_url":541,"body_html":542,"created_at":543,"updated_at":543,"author_association":544,"user":545,"reactions":549},627269618,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269618","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Fe2fba15b3f000b143672059250355def7d01d682660b8775ac8876c4ad69d8ea\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f38613939376466336331313739626661326334626662373036613464623631313f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Frank Alvarez\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Fe2fba15b3f000b143672059250355def7d01d682660b8775ac8876c4ad69d8ea\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f38613939376466336331313739626661326334626662373036613464623631313f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>Frank Alvarez\u003C\u002Fstrong> commented on \u003Cstrong>2018-08-31 02:33:45\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Where Nice article, but where are you using \u003Ccode>IHttpClientFactory\u003C\u002Fcode>? Shouldn't \u003Ccode>RocketClient\u003C\u002Fcode> be injecting \u003Ccode>IHttpClientFactory\u003C\u002Fcode> instead of \u003Ccode>HttpClient\u003C\u002Fcode>?\u003C\u002Fp>\n\u003Cp>Thanks\u003C\u002Fp>","2020-05-12T10:58:28Z","OWNER",{"login":546,"avatar_url":547,"html_url":548},"RehanSaeed","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2270364?v=4","https:\u002F\u002Fgithub.com\u002FRehanSaeed",{"url":550,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269618\u002Freactions",{"id":552,"html_url":553,"body_html":554,"created_at":555,"updated_at":555,"author_association":544,"user":556,"reactions":557},627269661,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269661","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2018-08-31 09:27:56\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Where Nice article, but where are you using \u003Ccode>IHttpClientFactory\u003C\u002Fcode>? Shouldn't \u003Ccode>RocketClient\u003C\u002Fcode> be injecting \u003Ccode>IHttpClientFactory\u003C\u002Fcode> instead of \u003Ccode>HttpClient\u003C\u002Fcode>?\u003C\u002Fp>\n\u003Cp>Thanks\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>\u003Ccode>IHttpClientFactory\u003C\u002Fcode> is kind of hidden away from you, you don't need to deal with it. You only need to provide some configuration for it and then consume the \u003Ccode>HttpClient\u003C\u002Fcode> it produces which gets injected into your typed client. This makes it much easier to use.\u003C\u002Fp>","2020-05-12T10:58:35Z",{"login":546,"avatar_url":547,"html_url":548},{"url":558,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269661\u002Freactions",{"id":560,"html_url":561,"body_html":562,"created_at":563,"updated_at":563,"author_association":544,"user":564,"reactions":565},627269708,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269708","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F5477507c5af1388b22cf5d1d9fca65d1f2f98199040ed866c94297d4872a46da\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f34356461663361316131626564323264356135346561343265346433633931343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Stan\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F5477507c5af1388b22cf5d1d9fca65d1f2f98199040ed866c94297d4872a46da\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f34356461663361316131626564323264356135346561343265346433633931343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>Stan\u003C\u002Fstrong> commented on \u003Cstrong>2018-08-31 11:24:09\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Great article, thank you! Would it make sense to add a 3rd \u003Ccode>DelegatingHandler\u003C\u002Fcode>, to give the Receiver a way to detect the retries from the Polly policies? Something along the lines of \u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fgithub.com\u002Fdotnet-architecture\u002FeShopOnContainers\u002Fblob\u002Fdev\u002Fsrc\u002FWeb\u002FWebMVC\u002FInfrastructure\u002FHttpClientRequestIdDelegatingHandler.cs\">this\u003C\u002Fa>.\u003C\u002Fp>","2020-05-12T10:58:42Z",{"login":546,"avatar_url":547,"html_url":548},{"url":566,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269708\u002Freactions",{"id":568,"html_url":569,"body_html":570,"created_at":571,"updated_at":571,"author_association":544,"user":572,"reactions":573},627269757,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269757","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F3799ae33e89dc81700a6d0d684e67da4aa6e5eece09fa1e9fee807086a7b07a6\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f66313936373566363137356462653337363334373835653531353239373630613f733d393626643d6d6d26723d67\">\u003Cimg alt=\"James\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F3799ae33e89dc81700a6d0d684e67da4aa6e5eece09fa1e9fee807086a7b07a6\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f66313936373566363137356462653337363334373835653531353239373630613f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>James\u003C\u002Fstrong> commented on \u003Cstrong>2018-09-04 11:38:59\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Thank you for the post, very informative, could you recommend a way that we could add a \u003Ccode>RefreshTokenDelegateHandler\u003C\u002Fcode> to the registration which could be configured per typed client?\u003C\u002Fp>","2020-05-12T10:58:49Z",{"login":546,"avatar_url":547,"html_url":548},{"url":574,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269757\u002Freactions",{"id":576,"html_url":577,"body_html":578,"created_at":579,"updated_at":579,"author_association":544,"user":580,"reactions":581},627269803,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269803","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2018-09-21 09:44:28\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Great article, thank you! Would it make sense to add a 3rd \u003Ccode>DelegatingHandler\u003C\u002Fcode>, to give the Receiver a way to detect the retries from the Polly policies? Something along the lines of \u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fgithub.com\u002Fdotnet-architecture\u002FeShopOnContainers\u002Fblob\u002Fdev\u002Fsrc\u002FWeb\u002FWebMVC\u002FInfrastructure\u002FHttpClientRequestIdDelegatingHandler.cs\">this\u003C\u002Fa>.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>\u003Ccode>X-Correlation-ID\u003C\u002Fcode> and \u003Ccode>X-Request-ID\u003C\u002Fcode> are the same thing, just different names because there is no standard.\u003C\u002Fp>","2020-05-12T10:58:55Z",{"login":546,"avatar_url":547,"html_url":548},{"url":582,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269803\u002Freactions",{"id":584,"html_url":585,"body_html":586,"created_at":587,"updated_at":587,"author_association":544,"user":588,"reactions":589},627269854,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269854","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2018-09-21 09:46:09\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Thank you for the post, very informative, could you recommend a way that we could add a \u003Ccode>RefreshTokenDelegateHandler\u003C\u002Fcode> to the registration which could be configured per typed client?\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>Yes, using a delegate handler for that purpose is the right way to go. I'm not aware of any libraries that provide that for you, IdentityServer4 might have something if you search for it.\u003C\u002Fp>","2020-05-12T10:59:02Z",{"login":546,"avatar_url":547,"html_url":548},{"url":590,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269854\u002Freactions",{"id":592,"html_url":593,"body_html":594,"created_at":595,"updated_at":595,"author_association":544,"user":596,"reactions":597},627269885,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269885","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F5bc09760dfd05e14949dd7808a4cdacb2de94e59c6d14eab11637ce18de56843\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f36373665623733616439393630643937386464363166316262353837313739373f733d393626643d6d6d26723d67\">\u003Cimg alt=\"DFT\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F5bc09760dfd05e14949dd7808a4cdacb2de94e59c6d14eab11637ce18de56843\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f36373665623733616439393630643937386464363166316262353837313739373f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>DFT\u003C\u002Fstrong> commented on \u003Cstrong>2019-02-09 03:28:20\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Thanks, I'm using Polly as a Nuget package with very similar settings and cases. What's the approach here? (Taking into account the maturity and the other several policies offered by Polly).\u003C\u002Fp>","2020-05-12T10:59:09Z",{"login":546,"avatar_url":547,"html_url":548},{"url":598,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269885\u002Freactions",{"id":600,"html_url":601,"body_html":602,"created_at":603,"updated_at":603,"author_association":544,"user":604,"reactions":605},627269915,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269915","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Ffeb657636251873e286e84721136520e467882cd8befe243b62d95b870f00bcb\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f35373736333434613736373739356265616334393733343036393665363233313f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Ritesh Koul\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Ffeb657636251873e286e84721136520e467882cd8befe243b62d95b870f00bcb\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f35373736333434613736373739356265616334393733343036393665363233313f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>Ritesh Koul\u003C\u002Fstrong> commented on \u003Cstrong>2019-06-20 19:17:39\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Hey Rehan one question how can we create sync policy in Polly for synchronous call to Webapi? Or what would be the right solution to create Polly policy where there is synchronous call to web api?\u003C\u002Fp>","2020-05-12T10:59:16Z",{"login":546,"avatar_url":547,"html_url":548},{"url":606,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269915\u002Freactions",{"id":608,"html_url":609,"body_html":610,"created_at":611,"updated_at":611,"author_association":544,"user":612,"reactions":613},627269973,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627269973","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2019-06-21 09:15:10\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Hey Rehan one question how can we create sync policy in Polly for synchronous call to Webapi? Or what would be the right solution to create Polly policy where there is synchronous call to web api?\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>Avoid using sync API's. It doesn't make sense to do so when making HTTP requests.\u003C\u002Fp>","2020-05-12T10:59:22Z",{"login":546,"avatar_url":547,"html_url":548},{"url":614,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627269973\u002Freactions",{"id":616,"html_url":617,"body_html":618,"created_at":619,"updated_at":619,"author_association":544,"user":620,"reactions":621},627270020,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627270020","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Fa572b71acf4ce33fdf641b045be9e640fd49b0395a8e7a5359ecfda1dee41595\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f61633365653766333466323038663133313263333836323533386563643738373f733d393626643d6d6d26723d67\">\u003Cimg alt=\"David I\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002Fa572b71acf4ce33fdf641b045be9e640fd49b0395a8e7a5359ecfda1dee41595\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f61633365653766333466323038663133313263333836323533386563643738373f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>David I\u003C\u002Fstrong> commented on \u003Cstrong>2019-11-18 20:25:45\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Hi Rehan, great article. I've followed your example and on the first call everything works fine, but if I make a second call I'm finding that I run a \u003Ccode>Cannot access a disposed object. ObjectDisposed_ObjectName_Name\u003C\u002Fcode> exception when the this line is called in the \u003Ccode>SendAsync\u003C\u002Fcode> function in \u003Ccode>CorrelationIdDelegatingHandler\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv>\u003Cpre>\u003Cspan>return\u003C\u002Fspan> \u003Cspan>base\u003C\u002Fspan>\u003Cspan>.\u003C\u002Fspan>\u003Cspan>SendAsync\u003C\u002Fspan>\u003Cspan>(\u003C\u002Fspan>\u003Cspan>request\u003C\u002Fspan>\u003Cspan>,\u003C\u002Fspan> \u003Cspan>cancellationToken\u003C\u002Fspan>\u003Cspan>)\u003C\u002Fspan>\u003Cspan>;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>I'm using ASP.NET Core 2.2, but not sure what I'm missing here?\u003C\u002Fp>","2020-05-12T10:59:29Z",{"login":546,"avatar_url":547,"html_url":548},{"url":622,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627270020\u002Freactions",{"id":624,"html_url":625,"body_html":626,"created_at":627,"updated_at":627,"author_association":544,"user":628,"reactions":629},627270070,"https:\u002F\u002Fgithub.com\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002F99#issuecomment-627270070","\n\u003Cp>\u003Ca target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\">\u003Cimg alt=\"Muhammad Rehan Saeed\" height=\"40\" width=\"40\" src=\"https:\u002F\u002Fcamo.githubusercontent.com\u002F8a07049df41b8a3839a3f4342f09ea8e6e7fa0065667687f04beca2d088a1dca\u002F68747470733a2f2f7777772e67726176617461722e636f6d2f6176617461722f32623266393030653361633066353535316462646537323864336262343935343f733d393626643d6d6d26723d67\" \u002F>\u003C\u002Fa> \u003Cstrong>\u003Ca rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\u002F\u002Frehansaeed.com\u002F\">Muhammad Rehan Saeed\u003C\u002Fa>\u003C\u002Fstrong> commented on \u003Cstrong>2019-11-29 17:47:02\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cblockquote>\n\u003Cp>Hi Rehan, great article. I've followed your example and on the first call everything works fine, but if I make a second call I'm finding that I run a \u003Ccode>Cannot access a disposed object. ObjectDisposed_ObjectName_Name\u003C\u002Fcode> exception when the this line is called in the \u003Ccode>SendAsync\u003C\u002Fcode> function in \u003Ccode>CorrelationIdDelegatingHandler\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cdiv>\u003Cpre>\u003Cspan>return\u003C\u002Fspan> \u003Cspan>base\u003C\u002Fspan>\u003Cspan>.\u003C\u002Fspan>\u003Cspan>SendAsync\u003C\u002Fspan>\u003Cspan>(\u003C\u002Fspan>\u003Cspan>request\u003C\u002Fspan>\u003Cspan>,\u003C\u002Fspan> \u003Cspan>cancellationToken\u003C\u002Fspan>\u003Cspan>)\u003C\u002Fspan>\u003Cspan>;\u003C\u002Fspan>\u003C\u002Fpre>\u003C\u002Fdiv>\n\u003Cp>I'm using ASP.NET Core 2.2, but not sure what I'm missing here?\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Cp>Sounds like you are reusing a disposed resource. Figure out what the resource is and either stop disposing it the second time or create a new one each time. You probably have the IoC lifetime setup incorrectly.\u003C\u002Fp>","2020-05-12T10:59:36Z",{"login":546,"avatar_url":547,"html_url":548},{"url":630,"total_count":4,"+1":4,"-1":4,"laugh":4,"hooray":4,"confused":4,"heart":4,"rocket":4,"eyes":4},"https:\u002F\u002Fapi.github.com\u002Frepos\u002FRehanSaeed\u002Frehansaeed.github.io\u002Fissues\u002Fcomments\u002F627270070\u002Freactions","2018-08-20T00:00:00+00:00","2021-04-04T00:00:00+00:00","How to optimally configure a HttpClient using the new HttpClientFactory API in ASP.NET Core 2.1 for best performance, usability, resiliency and easy of use.","md",[636,638,639,640,641,642,643],{"depth":637,"value":196},1,{"depth":637,"value":279},{"depth":637,"value":353},{"depth":637,"value":379},{"depth":637,"value":383},{"depth":637,"value":482},{"depth":637,"value":510},"\u002Fimages\u002Fhero\u002FMicrosoft-.NET-1366x768.png",{},"\u002Foptimally-configuring-asp-net-core-httpclientfactory\u002F",true,"posts\u002F2018\u002Foptimally-configuring-asp-net-core-httpclientfactory\u002Findex",[650,651,95,101,652],"ASP.NET Core","CorrelationId","Polly",9,[655,659,662,667,672,675,678,682,686,690,693,697,702,705,708,712,716,720,723,727,731,735,738,743,748,752,755,758,761,766,770,773,778,782,786,790,793,797,801,805,809,813,817,821,824,828,832,836,840,843,847,851,854,857,861,865,869,873,877,881,885,889,893,896,899,902,906,910,913,917,920,923,926,927,931,935,938,941,945,949,952,955,958,962,966,970,974,977,980,985,988,991,995,998,1002,1006,1009,1013,1016,1019,1023,1027,1031],{"title":656,"permalink":657,"heroImage":658,"timeToRead":637},"Just Start - The First Blog Post","\u002Fjust-start-the-first-blog-post\u002F","\u002Fimages\u002Fhero\u002FJust-Start-1366x768.png",{"title":660,"permalink":661,"heroImage":644,"timeToRead":531},"ConfigureAwait in Task Parallel Library (TPL)","\u002Fconfigureawait-task-parallel-library\u002F",{"title":663,"permalink":664,"heroImage":665,"timeToRead":666},"Stop The Brace Wars, Use StyleCop","\u002Fstop-brace-wars-use-stylecop\u002F","\u002Fimages\u002Fhero\u002FStyleCop-1366x768.png",3,{"title":668,"permalink":669,"heroImage":670,"timeToRead":671},"Reactive Extensions (Rx) - Part 1 - Replacing C# Events","\u002Freactive-extensions-part1-replacing-events\u002F","\u002Fimages\u002Fhero\u002FReactive-Extensions-1366x768.png",4,{"title":673,"permalink":674,"heroImage":670,"timeToRead":666},"Reactive Extensions (Rx) - Part 2 - Wrapping C# Events","\u002Freactive-extensions-part2-wrapping-events\u002F",{"title":676,"permalink":677,"heroImage":670,"timeToRead":531},"Reactive Extensions (Rx) - Part 3 - Naming Conventions","\u002Freactive-extensions-part3-naming-conventions\u002F",{"title":679,"permalink":680,"heroImage":681,"timeToRead":666},"WPF Metro Part 1 - Modern UI for WPF","\u002Fwpf-metro-part1-modern-ui-for-wpf\u002F","\u002Fimages\u002Fhero\u002FModern-UI-for-WPF-1366x768.png",{"title":683,"permalink":684,"heroImage":685,"timeToRead":666},"WPF Metro Part 2 - MahApps Metro","\u002Fwpf-metro-part2-mahapps-metro\u002F","\u002Fimages\u002Fhero\u002FMahApps-Metro-1366x768.png",{"title":687,"permalink":688,"heroImage":689,"timeToRead":666},"Windows 8.1 TouchScreen Gaming Laptops","\u002Fwindows-8-touchscreen-gaming-laptops\u002F","\u002Fimages\u002Fhero\u002FFry-Shutup-And-Take-My-Money-1366x768.png",{"title":691,"permalink":692,"heroImage":670,"timeToRead":666},"Reactive Extensions (Rx) - Part 4 - Replacing Timers","\u002Freactive-extensions-part4-replacing-timers\u002F",{"title":694,"permalink":695,"heroImage":696,"timeToRead":531},"WPF Metro Part 3 - Elysium","\u002Fwpf-metro-part3-elysium\u002F","\u002Fimages\u002Fhero\u002FElysium-1366x768.png",{"title":698,"permalink":699,"heroImage":700,"timeToRead":701},"WPF Metro Part 4 - Elysium Extra","\u002Fwpf-metro-part4-elysium-extra\u002F","\u002Fimages\u002Fhero\u002FElysium-Extra-1366x768.png",8,{"title":703,"permalink":704,"heroImage":670,"timeToRead":671},"Reactive Extensions (Rx) - Part 5 - Awaiting Observables","\u002Freactive-extensions-part5-awaiting-observables\u002F",{"title":706,"permalink":707,"heroImage":644,"timeToRead":701},"GetHashCode Made Easy","\u002Fgethashcode-made-easy\u002F",{"title":709,"permalink":710,"heroImage":670,"timeToRead":711},"Reactive Extensions (Rx) - Part 6 - Task ToObservable","\u002Freactive-extensions-part6-task-toobservable\u002F",5,{"title":713,"permalink":714,"heroImage":715,"timeToRead":637},"Portable Class Library (PCL) version of NotificationsExtensions NuGet package","\u002Fportable-class-library-version-of-notificationsextensions-nuget-package\u002F","\u002Fimages\u002Fhero\u002FNuGet-1366x768.png",{"title":717,"permalink":718,"heroImage":719,"timeToRead":711},"Model-View-ViewModel (MVVM) - Part 1 - Overview","\u002Fmodel-view-viewmodel-mvvm-part1-overview\u002F","\u002Fimages\u002Fhero\u002FMVVM-1366x768.png",{"title":721,"permalink":722,"heroImage":719,"timeToRead":671},"Model-View-ViewModel (MVVM) - Part 2 - IDisposable","\u002Fmodel-view-viewmodel-mvvm-part2-idisposable\u002F",{"title":724,"permalink":725,"heroImage":719,"timeToRead":726},"Model-View-ViewModel (MVVM) - Part 3 - INotifyPropertyChanged","\u002Fmodel-view-viewmodel-mvvm-part3-inotifypropertychanged\u002F",11,{"title":728,"permalink":729,"heroImage":730,"timeToRead":666},"Naming Conventions","\u002Fnaming-conventions\u002F","\u002Fimages\u002Fhero\u002FNaming-Conventions-1366x768.png",{"title":732,"permalink":733,"heroImage":719,"timeToRead":734},"Model-View-ViewModel (MVVM) - Part 4 - INotifyDataErrorInfo","\u002Fmodel-view-viewmodel-mvvm-part4-inotifydataerrorinfo\u002F",12,{"title":736,"permalink":737,"heroImage":700,"timeToRead":671},"Elysium Extra 1.1 Released","\u002Felysium-extra-1-1-released\u002F",{"title":739,"permalink":740,"heroImage":741,"timeToRead":742},"ASP.NET Core Boilerplate","\u002Fasp-net-mvc-boilerplate\u002F","\u002Fimages\u002Fhero\u002FASP.NET-Core-Boilerplate-1366x768.png",7,{"title":744,"permalink":745,"heroImage":746,"timeToRead":747},"Internet Favicon Madness (Updated)","\u002Finternet-favicon-madness\u002F","\u002Fimages\u002Fhero\u002FFavicons-1366x768.png",17,{"title":749,"permalink":750,"heroImage":751,"timeToRead":742},"Custom Visual Studio Project Templates","\u002Fcustom-visual-studio-project-templates\u002F","\u002Fimages\u002Fhero\u002FVisual-Studio-1366x768.png",{"title":753,"permalink":754,"heroImage":751,"timeToRead":666},"Configuration File Transforms In Visual Studio Should Be Built In","\u002Fconfiguration-file-transforms-in-visual-studio-should-be-built-in\u002F",{"title":756,"permalink":757,"heroImage":741,"timeToRead":726},"Securing the ASP.NET MVC Web.config","\u002Fsecuring-the-aspnet-mvc-web-config\u002F",{"title":759,"permalink":760,"heroImage":670,"timeToRead":531},"Reactive Extensions (Rx) - Part 7 - Sample Events","\u002Freactive-extensions-part7-sample-events\u002F",{"title":762,"permalink":763,"heroImage":764,"timeToRead":765},"NWebSec ASP.NET MVC Security Through HTTP Headers","\u002Fnwebsec-asp-net-mvc-security-through-http-headers\u002F","\u002Fimages\u002Fhero\u002FNWebSec-1366x768.png",6,{"title":767,"permalink":768,"heroImage":769,"timeToRead":188},"Content Security Policy (CSP) for ASP.NET MVC","\u002Fcontent-security-policy-for-asp-net-mvc\u002F","\u002Fimages\u002Fhero\u002FContent-Security-Policy-CSP-for-ASP.NET-MVC-1366x768.png",{"title":771,"permalink":772,"heroImage":644,"timeToRead":711},"C# 6.0 - Saving Developers From Themselves","\u002Fc-6-0-saving-developers-from-themselves\u002F",{"title":774,"permalink":775,"heroImage":776,"timeToRead":777},"Building RSS\u002FAtom Feeds for ASP.NET MVC","\u002Fbuilding-rssatom-feeds-for-asp-net-mvc\u002F","\u002Fimages\u002Fhero\u002FRSS-And-Atom-1366x768.png",19,{"title":779,"permalink":780,"heroImage":781,"timeToRead":726},"Canonical URL's for ASP.NET MVC","\u002Fcanonical-urls-for-asp-net-mvc\u002F","\u002Fimages\u002Fhero\u002FLink-Juice-1366x768.png",{"title":783,"permalink":784,"heroImage":785,"timeToRead":671},"Dynamically Generating Robots.txt Using ASP.NET MVC","\u002Fdynamically-generating-robots-txt-using-asp-net-mvc\u002F","\u002Fimages\u002Fhero\u002FRobots.txt-1366x768.jpg",{"title":787,"permalink":788,"heroImage":789,"timeToRead":671},"Minifying HTML for ASP.NET MVC","\u002Fminifying-html-for-asp-net-mvc\u002F","\u002Fimages\u002Fhero\u002FThe-Internet-Is-A-Series-Of-Tubes-1366x768.jpg",{"title":791,"permalink":792,"heroImage":741,"timeToRead":531},"Whats New in ASP.NET Core Boilerplate","\u002Fwhats-new-in-asp-net-5-mvc-6-boilerplate\u002F",{"title":794,"permalink":795,"heroImage":796,"timeToRead":742},"Dynamically Generating Sitemap.xml for ASP.NET MVC","\u002Fdynamically-generating-sitemap-xml-for-asp-net-mvc\u002F","\u002Fimages\u002Fhero\u002FSitemaps-1366x768.png",{"title":798,"permalink":799,"heroImage":800,"timeToRead":531},"So I've Been Awarded Microsoft MVP Status!","\u002Fso-ive-been-awarded-microsoft-mvp-status\u002F","\u002Fimages\u002Fhero\u002FMicrosoft-MVP-1366x768.png",{"title":802,"permalink":803,"heroImage":804,"timeToRead":637},".NET Big-O Algorithm Complexity Cheat Sheet","\u002Fnet-big-o-algorithm-complexity-cheat-sheet\u002F","\u002Fimages\u002Fhero\u002FNET-Big-O-Algorithm-Complexity-Cheat-Sheet-1366x768.jpg",{"title":806,"permalink":807,"heroImage":808,"timeToRead":666},"Logging with Serilog.Exceptions","\u002Flogging-with-serilog-exceptions\u002F","\u002Fimages\u002Fhero\u002FSerilog.Exceptions-1366x768.png",{"title":810,"permalink":811,"heroImage":812,"timeToRead":637},"Make Certificate","\u002Fmake-certificate\u002F","\u002Fimages\u002Fhero\u002FMake-Certificate-1366x768.png",{"title":814,"permalink":815,"heroImage":816,"timeToRead":531},"Colorful.Console","\u002Fcolorful-console\u002F","\u002Fimages\u002Fhero\u002FColorful.Console-1366x768.png",{"title":818,"permalink":819,"heroImage":820,"timeToRead":666},"Subresource Integrity TagHelper Using ASP.NET Core - Part 1","\u002Fsubresource-integrity-taghelper-using-asp-net-core\u002F","\u002Fimages\u002Fhero\u002FMake-Security-Easy-1366x768.png",{"title":822,"permalink":823,"heroImage":820,"timeToRead":671},"Subresource Integrity TagHelper Using ASP.NET Core - Part 2","\u002Fsubresource-integrity-taghelper-using-asp-net-core-part-2\u002F",{"title":825,"permalink":826,"heroImage":827,"timeToRead":711},"Social TagHelpers for ASP.NET Core","\u002Fsocial-taghelpers-for-asp-net-core\u002F","\u002Fimages\u002Fhero\u002FSocial-Media-1366x768.png",{"title":829,"permalink":830,"heroImage":831,"timeToRead":765},"Azure Active Directory Versus Identity Server","\u002Fazure-active-directory-versus-identity-server\u002F","\u002Fimages\u002Fhero\u002FAzure-Active-Directory-Versus-Identity-Server-1366x768.png",{"title":833,"permalink":834,"heroImage":835,"timeToRead":531},"ASP.NET Core Fluent Interface Extensions","\u002Fasp-net-core-fluent-interface-extensions\u002F","\u002Fimages\u002Fhero\u002FFluent-Interface-All-The-Things-1366x768.png",{"title":837,"permalink":838,"heroImage":839,"timeToRead":726},"NGINX for ASP.NET Core In-Depth","\u002Fnginx-asp-net-core-depth\u002F","\u002Fimages\u002Fhero\u002FNGINX-1366x768.png",{"title":841,"permalink":842,"heroImage":644,"timeToRead":531},"The Dotnet Watch Tool","\u002Fthe-dotnet-watch-tool\u002F",{"title":844,"permalink":845,"heroImage":846,"timeToRead":671},"Making Application Insights Fast & Secure","\u002Fmaking-application-insights-fast-and-secure\u002F","\u002Fimages\u002Fhero\u002FApplication-Insights-1366x768.png",{"title":848,"permalink":849,"heroImage":850,"timeToRead":742},"SEO Friendly URL's for ASP.NET Core","\u002Fseo-friendly-urls-asp-net-core\u002F","\u002Fimages\u002Fhero\u002FSearch-Engine-Optimization-SEO-1366x768.png",{"title":852,"permalink":853,"heroImage":670,"timeToRead":637},"Reactive Extensions (Rx) - Part 8 - Timeouts","\u002Freactive-extensions-rx-part-8-timeouts\u002F",{"title":855,"permalink":856,"heroImage":644,"timeToRead":671},"Custom Project Templates Using dotnet new","\u002Fcustom-project-templates-using-dotnet-new\u002F",{"title":858,"permalink":859,"heroImage":860,"timeToRead":701},"Cross-Platform DevOps for .NET Core","\u002Fcross-platform-devops-net-core\u002F","\u002Fimages\u002Fhero\u002FDotnet-Cake-AppVeyor-Travis-1366x768.png",{"title":862,"permalink":863,"heroImage":864,"timeToRead":742},"Cleaning Up CSPROJ","\u002Fcleaning-up-csproj\u002F","\u002Fimages\u002Fhero\u002FCleaning-Up-CSPROJ-1366x768.png",{"title":866,"permalink":867,"heroImage":868,"timeToRead":653},"dotnet new Feature Selection","\u002Fdotnet-new-feature-selection\u002F","\u002Fimages\u002Fhero\u002FWho-Wants-To-Be-A-Millionaire-1366x768.png",{"title":870,"permalink":871,"heroImage":872,"timeToRead":671},"ASP.NET Core Lazy Command Pattern","\u002Fasp-net-core-lazy-command-pattern\u002F","\u002Fimages\u002Fhero\u002FASP.NET-Core-Lazy-Command-Pattern-1366x768.png",{"title":874,"permalink":875,"heroImage":876,"timeToRead":531},"Structured Data using Schema.NET","\u002Fstructured-data-using-schema-net\u002F","\u002Fimages\u002Fhero\u002FSchema.NET-1366x768.png",{"title":878,"permalink":879,"heroImage":880,"timeToRead":765},"Keeping Up With Software Development","\u002Fkeeping-software-development\u002F","\u002Fimages\u002Fhero\u002FKeeping-up-with-Software-Development-1366x768.png",{"title":882,"permalink":883,"heroImage":884,"timeToRead":531},"A Very Generic .editorconfig File (Updated)","\u002Fgeneric-editorconfig-file\u002F","\u002Fimages\u002Fhero\u002FA-Very-Generic-Editorconfig-File-1366x768.png",{"title":886,"permalink":887,"heroImage":888,"timeToRead":711},"ASP.NET Core Caching in Practice","\u002Fasp-net-core-caching-in-practice\u002F","\u002Fimages\u002Fhero\u002FASP.NET-Core-Caching-in-Practice-1366x768.png",{"title":890,"permalink":891,"heroImage":892,"timeToRead":637},"Docker Read-Only File Systems","\u002Fdocker-read-file-systems\u002F","\u002Fimages\u002Fhero\u002FDocker-1366x768.png",{"title":894,"permalink":895,"heroImage":892,"timeToRead":666},"Docker Labels in Depth","\u002Fdocker-labels-depth\u002F",{"title":897,"permalink":898,"heroImage":892,"timeToRead":671},"Useful Docker Images - Part 1","\u002Fuseful-docker-images-part1\u002F",{"title":900,"permalink":901,"heroImage":892,"timeToRead":711},"Useful Docker Images - Part 2","\u002Fuseful-docker-images-part2\u002F",{"title":903,"permalink":904,"heroImage":905,"timeToRead":671},"Writing your Webpack configuration in TypeScript","\u002Fwriting-your-webpack-configuration-in-typescript\u002F","\u002Fimages\u002Fhero\u002FTypeScript-1366x768.png",{"title":907,"permalink":908,"heroImage":909,"timeToRead":711},"Writing Code while Asleep","\u002Fwriting-code-asleep\u002F","\u002Fimages\u002Fhero\u002FWhile-Alive-Eat-Sleep-Code-Repeat-1366x768.png",{"title":911,"permalink":912,"heroImage":644,"timeToRead":531},"The Dotnet Watch Tool Revisited","\u002Fthe-dotnet-watch-tool-revisited\u002F",{"title":914,"permalink":915,"heroImage":916,"timeToRead":531},".NET Boxed","\u002Fnet-boxed\u002F","\u002Fimages\u002Fhero\u002FDotnet-Boxed-1366x768.png",{"title":918,"permalink":919,"heroImage":644,"timeToRead":531},"Migrating to Entity Framework Core Seed Data","\u002Fmigrating-to-entity-framework-core-seed-data\u002F",{"title":921,"permalink":922,"heroImage":644,"timeToRead":666},"Optimally Configuring Entity Framework Core","\u002Foptimally-configuring-entity-framework-core\u002F",{"title":924,"permalink":925,"heroImage":644,"timeToRead":637},"ASP.NET Core Hidden Gem - QueryHelpers","\u002Fasp-net-core-hidden-gem-queryhelpers\u002F",{"title":39,"permalink":646,"heroImage":644,"timeToRead":653},{"title":928,"permalink":929,"heroImage":930,"timeToRead":742},"PluralSight vs LinkedIn Learning vs FrontendMasters vs Egghead.io vs YouTube","\u002Fpluralsight-vs-linkedin-learning-vs-frontendmasters-vs-egghead-io-vs-youtube\u002F","\u002Fimages\u002Fhero\u002FOnline-Learning-1366x768.png",{"title":932,"permalink":933,"heroImage":934,"timeToRead":653},"Is ASP.NET Core now a Mature Platform?","\u002Fis-asp-net-core-now-a-mature-platform\u002F","\u002Fimages\u002Fhero\u002FRocket-1366x768.jpg",{"title":936,"permalink":937,"heroImage":916,"timeToRead":653},"A Simple and Fast Object Mapper","\u002Fa-simple-and-fast-object-mapper\u002F",{"title":939,"permalink":940,"heroImage":892,"timeToRead":637},"Securing ASP.NET Core in Docker","\u002Fsecuring-asp-net-core-in-docker\u002F",{"title":942,"permalink":943,"heroImage":944,"timeToRead":671},"Git Cloning the Windows OS Repo","\u002Fgit-cloning-the-windows-os-repo\u002F","\u002Fimages\u002Fhero\u002FWindows-1366x768.png",{"title":946,"permalink":947,"heroImage":948,"timeToRead":742},".gitattributes Best Practices","\u002Fgitattributes-best-practices\u002F","\u002Fimages\u002Fhero\u002FGit-1366x768.png",{"title":950,"permalink":951,"heroImage":644,"timeToRead":666},"Unit Testing dotnet new Templates","\u002Funit-testing-dotnet-new-templates\u002F",{"title":953,"permalink":954,"heroImage":916,"timeToRead":711},"What dotnet new Could Be","\u002Fwhat-dotnet-new-could-be\u002F",{"title":956,"permalink":957,"heroImage":644,"timeToRead":671},"ASP.NET Core Integration Testing & Mocking using Moq","\u002Fasp-net-core-integration-testing-mocking-using-moq\u002F",{"title":959,"permalink":960,"heroImage":961,"timeToRead":742},"Choosing a Static Site Generator","\u002Fchoosing-a-static-site-generator\u002F","\u002Fimages\u002Fhero\u002FStatic-Site-Generators-1600x900.png",{"title":963,"permalink":964,"heroImage":965,"timeToRead":531},"Spicing up your Browser Console","\u002Fspicing-up-your-browser-console\u002F","\u002Fimages\u002Fhero\u002FFiglet-Fonts-1600x900.png",{"title":967,"permalink":968,"heroImage":969,"timeToRead":711},"Racism in Software Development & Beyond","\u002Fracism-in-software-development-and-beyond\u002F","\u002Fimages\u002Fhero\u002FBlack-Glowing-Fist-1600x900.png",{"title":971,"permalink":972,"heroImage":973,"timeToRead":711},"The Easiest Way to Version NuGet Packages","\u002Fthe-easiest-way-to-version-nuget-packages\u002F","\u002Fimages\u002Fhero\u002FSemantic-Versioning-1600x900.png",{"title":975,"permalink":976,"heroImage":715,"timeToRead":765},"The Fastest NuGet Package Ever Published (Probably)","\u002Fthe-fastest-nuget-package-ever-published-probably\u002F",{"title":978,"permalink":979,"heroImage":644,"timeToRead":666},"Automating .NET Security Updates","\u002Fautomating-dotnet-security-updates\u002F",{"title":981,"permalink":982,"heroImage":983,"timeToRead":984},"Deep Dive into Open Telemetry for .NET","\u002Fdeep-dive-into-open-telemetry-for-net\u002F","\u002Fimages\u002Fhero\u002FOpen-Telemetry-1600x900.png",10,{"title":986,"permalink":987,"heroImage":983,"timeToRead":666},"Open Telemetry for ASP.NET Core","\u002Fopen-telemetry-for-asp-net-core\u002F",{"title":989,"permalink":990,"heroImage":983,"timeToRead":666},"Exporting Open Telemetry Data to Jaeger","\u002Fexporting-open-telemetry-data-to-jaeger\u002F",{"title":992,"permalink":993,"heroImage":994,"timeToRead":666},"A System for Grouping & Sorting CSS Properties","\u002Fsystem-for-grouping-and-sorting-css-properties\u002F","\u002Fimages\u002Fhero\u002FCSS-1600x900.png",{"title":996,"permalink":997,"heroImage":994,"timeToRead":765},"CSS General Rules of Thumb","\u002Fcss-general-rules-of-thumb\u002F",{"title":999,"permalink":1000,"heroImage":1001,"timeToRead":671},"Web Component Custom Element Gotchas","\u002Fweb-component-custom-element-gotchas\u002F","\u002Fimages\u002Fhero\u002FWeb-Components-1600x900.png",{"title":1003,"permalink":1004,"heroImage":1005,"timeToRead":531},"Code Coverage & Frontend Testing","\u002Fcode-coverage-and-frontend-testing\u002F","\u002Fimages\u002Fhero\u002FJest-Cypress-1600x900.png",{"title":1007,"permalink":1008,"heroImage":751,"timeToRead":637},".NET Boxed Visual Studio Integration","\u002Fdotnet-boxed-visual-studio-integration\u002F",{"title":1010,"permalink":1011,"heroImage":1012,"timeToRead":666},"The Windows Package Manager","\u002Fwindows-package-manager\u002F","\u002Fimages\u002Fhero\u002FWinget-1600x900.png",{"title":1014,"permalink":1015,"heroImage":644,"timeToRead":666},"The Problem with C# 10 Implicit Usings","\u002Fthe-problem-with-csharp-10-implicit-usings\u002F",{"title":1017,"permalink":1018,"heroImage":983,"timeToRead":671},"Optimally Configuring Open Telemetry Tracing for ASP.NET Core","\u002Foptimally-configuring-open-telemetry-tracing-for-asp-net-core\u002F",{"title":1020,"permalink":1021,"heroImage":1022,"timeToRead":531},"Live Streaming .NET","\u002Flive-streaming-dotnet\u002F","\u002Fimages\u002Fhero\u002FMy-YouTube-1920x1080.jpg",{"title":1024,"permalink":1025,"heroImage":1026,"timeToRead":531},"I Was Awarded as an Open UK Honouree","\u002Fopen-uk-honouree\u002F","\u002Fimages\u002Fhero\u002FOpen-UK-Honours-1366x768.jpg",{"title":1028,"permalink":1029,"heroImage":1030,"timeToRead":671},"On the Etiquette of Pull Request Comments","\u002Fon-the-etiquette-of-pull-request-comments\u002F","\u002Fimages\u002Fhero\u002FPrecious-PR-1600x900.jpg",{"title":1032,"permalink":1033,"heroImage":1034,"timeToRead":637},"AI Gone Rogue","\u002Fai-gone-rogue\u002F","\u002Fimages\u002Fhero\u002FHAL-9000-Prop-1600x900.png",{"left":4,"top":4,"width":24,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1036},"\u003Cpath fill=\"currentColor\" d=\"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.55 96.55 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.3 96.3 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96s-42.981-96-96-96\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1038},"\u003Cpath fill=\"currentColor\" d=\"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48c27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1040},"\u003Cpath fill=\"currentColor\" d=\"M459.37 151.716c.325 4.548.325 9.097.325 13.645c0 138.72-105.583 298.558-298.558 298.558c-59.452 0-114.68-17.219-161.137-47.106c8.447.974 16.568 1.299 25.34 1.299c49.055 0 94.213-16.568 130.274-44.832c-46.132-.975-84.792-31.188-98.112-72.772c6.498.974 12.995 1.624 19.818 1.624c9.421 0 18.843-1.3 27.614-3.573c-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319c-28.264-18.843-46.781-51.005-46.781-87.391c0-19.492 5.197-37.36 14.294-52.954c51.655 63.675 129.3 105.258 216.365 109.807c-1.624-7.797-2.599-15.918-2.599-24.04c0-57.828 46.782-104.934 104.934-104.934c30.213 0 57.502 12.67 76.67 33.137c23.715-4.548 46.456-13.32 66.599-25.34c-7.798 24.366-24.366 44.833-46.132 57.827c21.117-2.273 41.584-8.122 60.426-16.243c-14.292 20.791-32.161 39.308-52.628 54.253\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1042},"\u003Cpath fill=\"currentColor\" d=\"M201.5 305.5c-13.8 0-24.9-11.1-24.9-24.6c0-13.8 11.1-24.9 24.9-24.9c13.6 0 24.6 11.1 24.6 24.9c0 13.6-11.1 24.6-24.6 24.6M504 256c0 137-111 248-248 248S8 393 8 256S119 8 256 8s248 111 248 248m-132.3-41.2c-9.4 0-17.7 3.9-23.8 10c-22.4-15.5-52.6-25.5-86.1-26.6l17.4-78.3l55.4 12.5c0 13.6 11.1 24.6 24.6 24.6c13.8 0 24.9-11.3 24.9-24.9s-11.1-24.9-24.9-24.9c-9.7 0-18 5.8-22.1 13.8l-61.2-13.6c-3-.8-6.1 1.4-6.9 4.4l-19.1 86.4c-33.2 1.4-63.1 11.3-85.5 26.8c-6.1-6.4-14.7-10.2-24.1-10.2c-34.9 0-46.3 46.9-14.4 62.8c-1.1 5-1.7 10.2-1.7 15.5c0 52.6 59.2 95.2 132 95.2c73.1 0 132.3-42.6 132.3-95.2c0-5.3-.6-10.8-1.9-15.8c31.3-16 19.8-62.5-14.9-62.5M302.8 331c-18.2 18.2-76.1 17.9-93.6 0c-2.2-2.2-6.1-2.2-8.3 0c-2.5 2.5-2.5 6.4 0 8.6c22.8 22.8 87.3 22.8 110.2 0c2.5-2.2 2.5-6.1 0-8.6c-2.2-2.2-6.1-2.2-8.3 0m7.7-75c-13.6 0-24.6 11.1-24.6 24.9c0 13.6 11.1 24.6 24.6 24.6c13.8 0 24.9-11.1 24.9-24.6c0-13.8-11-24.9-24.9-24.9\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1044},"\u003Cpath fill=\"currentColor\" d=\"M512 194.8c0 101.3-82.4 183.8-183.8 183.8c-101.7 0-184.4-82.4-184.4-183.8c0-101.6 82.7-184.3 184.4-184.3C429.6 10.5 512 93.2 512 194.8M0 501.5h90v-491H0z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":1046},"\u003Cpath fill=\"currentColor\" d=\"m20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379c-.197-.069-.42-.098-.57-.241c-.152-.143-.196-.366-.231-.572c-.065-.378-.125-.756-.192-1.133c-.057-.325-.102-.69-.25-.987c-.195-.4-.597-.634-.996-.788a6 6 0 0 0-.626-.194c-1-.263-2.05-.36-3.077-.416a26 26 0 0 0-3.7.062c-.915.083-1.88.184-2.75.5c-.318.116-.646.256-.888.501c-.297.302-.393.77-.177 1.146c.154.267.415.456.692.58c.36.162.737.284 1.123.366c1.075.238 2.189.331 3.287.37q1.829.074 3.65-.118q.449-.05.896-.119c.352-.054.578-.513.474-.834c-.124-.383-.457-.531-.834-.473c-.466.074-.96.108-1.382.146q-1.767.12-3.536.006a22 22 0 0 1-1.157-.107c-.086-.01-.18-.025-.258-.036q-.364-.055-.724-.13c-.111-.027-.111-.185 0-.212h.005q.416-.09.838-.147h.002c.131-.009.263-.032.394-.048a25 25 0 0 1 3.426-.12q1.011.029 2.017.144l.228.031q.4.06.798.145c.392.085.895.113 1.07.542c.055.137.08.288.111.431l.319 1.484a.237.237 0 0 1-.199.284h-.003l-.112.015a37 37 0 0 1-4.743.295a37 37 0 0 1-4.699-.304c-.14-.017-.293-.042-.417-.06c-.326-.048-.649-.108-.973-.161c-.393-.065-.768-.032-1.123.161c-.29.16-.527.404-.675.701c-.154.316-.199.66-.267 1c-.069.34-.176.707-.135 1.056c.087.753.613 1.365 1.37 1.502a39.7 39.7 0 0 0 11.343.376a.483.483 0 0 1 .535.53l-.071.697l-1.018 9.907c-.041.41-.047.832-.125 1.237c-.122.637-.553 1.028-1.182 1.171q-.868.197-1.756.205c-.656.004-1.31-.025-1.966-.022c-.699.004-1.556-.06-2.095-.58c-.475-.458-.54-1.174-.605-1.793l-.731-7.013l-.322-3.094c-.037-.351-.286-.695-.678-.678c-.336.015-.718.3-.678.679l.228 2.185l.949 9.112c.147 1.344 1.174 2.068 2.446 2.272c.742.12 1.503.144 2.257.156c.966.016 1.942.053 2.892-.122c1.408-.258 2.465-1.198 2.616-2.657l1.024-9.995l.215-2.087a.48.48 0 0 1 .39-.426c.402-.078.787-.212 1.074-.518c.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233c-2.416.359-4.866.54-7.308.46c-1.748-.06-3.477-.254-5.207-.498c-.17-.024-.353-.055-.47-.18c-.22-.236-.111-.71-.054-.995c.052-.26.152-.609.463-.646c.484-.057 1.046.148 1.526.22q.865.132 1.737.212c2.48.226 5.002.19 7.472-.14q.675-.09 1.345-.21c.399-.072.84-.206 1.08.206c.166.281.188.657.162.974a.54.54 0 0 1-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a6 6 0 0 1-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38c0 0 1.243.065 1.658.065c.447 0 1.786-.065 1.786-.065c.783 0 1.434-.6 1.499-1.38l.94-9.95a4 4 0 0 0-1.322-.238c-.826 0-1.491.284-2.26.613\"\u002F>",{"left":4,"top":4,"width":27,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1048},"\u003Cpath fill=\"currentColor\" d=\"M111.4 295.9c-3.5 19.2-17.4 108.7-21.5 134c-.3 1.8-1 2.5-3 2.5H12.3c-7.6 0-13.1-6.6-12.1-13.9L58.8 46.6c1.5-9.6 10.1-16.9 20-16.9c152.3 0 165.1-3.7 204 11.4c60.1 23.3 65.6 79.5 44 140.3c-21.5 62.6-72.5 89.5-140.1 90.3c-43.4.7-69.5-7-75.3 24.2M357.1 152c-1.8-1.3-2.5-1.8-3 1.3c-2 11.4-5.1 22.5-8.8 33.6c-39.9 113.8-150.5 103.9-204.5 103.9c-6.1 0-10.1 3.3-10.9 9.4c-22.6 140.4-27.1 169.7-27.1 169.7c-1 7.1 3.5 12.9 10.6 12.9h63.5c8.6 0 15.7-6.3 17.4-14.9c.7-5.4-1.1 6.1 14.4-91.3c4.6-22 14.3-19.7 29.3-19.7c71 0 126.4-28.8 142.9-112.3c6.5-34.8 4.6-71.4-23.8-92.6\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":1050},"\u003Cpath fill=\"currentColor\" d=\"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8m0 448c-110.532 0-200-89.431-200-200c0-110.495 89.472-200 200-200c110.491 0 200 89.471 200 200c0 110.53-89.431 200-200 200m107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516c17.561-9.845 28.324-16.541 28.324-29.579c0-17.246-21.999-28.693-39.784-28.693c-23.189 0-33.894 10.977-48.942 29.969c-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8M298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42s18.841-42 42-42s42 18.841 42 42\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":1052},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 12H5m7 7l-7-7l7-7\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":1054},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7l7 7l-7 7\"\u002F>",1793533266104]