Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class GrpcHttpClientBuilderExtensions
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class GrpcHttpClientBuilderExtensions
  11. | gRPC for .NET ">
  12. <meta name="generator" content="docfx 2.36.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <meta property="docfx:navrel" content="../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../index.html">
  34. <img id="logo" class="svg" src="../logo.svg" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions">
  73. <h1 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions" class="text-break">Class GrpcHttpClientBuilderExtensions
  74. </h1>
  75. <div class="markdown level0 summary"><p>Extension methods for configuring an <see cref="!:IHttpClientBuilder"></see>.</p>
  76. </div>
  77. <div class="markdown level0 conceptual"></div>
  78. <div class="inheritance">
  79. <h5>Inheritance</h5>
  80. <div class="level0"><span class="xref">System.Object</span></div>
  81. <div class="level1"><span class="xref">GrpcHttpClientBuilderExtensions</span></div>
  82. </div>
  83. <h6><strong>Namespace</strong>: <a class="xref" href="Microsoft.Extensions.DependencyInjection.html">Microsoft.Extensions.DependencyInjection</a></h6>
  84. <h6><strong>Assembly</strong>: Grpc.Net.ClientFactory.dll</h6>
  85. <h5 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_syntax">Syntax</h5>
  86. <div class="codewrapper">
  87. <pre><code class="lang-csharp hljs">public static class GrpcHttpClientBuilderExtensions : object</code></pre>
  88. </div>
  89. <h3 id="methods">Methods
  90. </h3>
  91. <a id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_AddInterceptor_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.AddInterceptor*"></a>
  92. <h4 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_AddInterceptor_IHttpClientBuilder_Func_Interceptor__" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.AddInterceptor(IHttpClientBuilder,Func{Interceptor})">AddInterceptor(IHttpClientBuilder, Func&lt;Interceptor&gt;)</h4>
  93. <div class="markdown level1 summary"><p>Adds a delegate that will be used to create an additional inteceptor for a gRPC client.</p>
  94. </div>
  95. <div class="markdown level1 conceptual"></div>
  96. <h5 class="decalaration">Declaration</h5>
  97. <div class="codewrapper">
  98. <pre><code class="lang-csharp hljs">public static IHttpClientBuilder AddInterceptor(this IHttpClientBuilder builder, Func&lt;Interceptor&gt; configureInvoker)</code></pre>
  99. </div>
  100. <h5 class="parameters">Parameters</h5>
  101. <table class="table table-bordered table-striped table-condensed">
  102. <thead>
  103. <tr>
  104. <th>Type</th>
  105. <th>Name</th>
  106. <th>Description</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <tr>
  111. <td><span class="xref">IHttpClientBuilder</span></td>
  112. <td><span class="parametername">builder</span></td>
  113. <td><p>The <see cref="!:IHttpClientBuilder"></see>.</p>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td><span class="xref">Func</span>&lt;<span class="xref">Interceptor</span>&gt;</td>
  118. <td><span class="parametername">configureInvoker</span></td>
  119. <td><p>A delegate that is used to create an <see cref="!:Interceptor"></see>.</p>
  120. </td>
  121. </tr>
  122. </tbody>
  123. </table>
  124. <h5 class="returns">Returns</h5>
  125. <table class="table table-bordered table-striped table-condensed">
  126. <thead>
  127. <tr>
  128. <th>Type</th>
  129. <th>Description</th>
  130. </tr>
  131. </thead>
  132. <tbody>
  133. <tr>
  134. <td><span class="xref">IHttpClientBuilder</span></td>
  135. <td><p>An <see cref="!:IHttpClientBuilder"></see> that can be used to configure the client.</p>
  136. </td>
  137. </tr>
  138. </tbody>
  139. </table>
  140. <a id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_AddInterceptor_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.AddInterceptor*"></a>
  141. <h4 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_AddInterceptor_IHttpClientBuilder_Func_IServiceProvider_Interceptor__" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.AddInterceptor(IHttpClientBuilder,Func{IServiceProvider,Interceptor})">AddInterceptor(IHttpClientBuilder, Func&lt;IServiceProvider, Interceptor&gt;)</h4>
  142. <div class="markdown level1 summary"><p>Adds a delegate that will be used to create an additional inteceptor for a gRPC client.</p>
  143. </div>
  144. <div class="markdown level1 conceptual"></div>
  145. <h5 class="decalaration">Declaration</h5>
  146. <div class="codewrapper">
  147. <pre><code class="lang-csharp hljs">public static IHttpClientBuilder AddInterceptor(this IHttpClientBuilder builder, Func&lt;IServiceProvider, Interceptor&gt; configureInvoker)</code></pre>
  148. </div>
  149. <h5 class="parameters">Parameters</h5>
  150. <table class="table table-bordered table-striped table-condensed">
  151. <thead>
  152. <tr>
  153. <th>Type</th>
  154. <th>Name</th>
  155. <th>Description</th>
  156. </tr>
  157. </thead>
  158. <tbody>
  159. <tr>
  160. <td><span class="xref">IHttpClientBuilder</span></td>
  161. <td><span class="parametername">builder</span></td>
  162. <td><p>The <see cref="!:IHttpClientBuilder"></see>.</p>
  163. </td>
  164. </tr>
  165. <tr>
  166. <td><span class="xref">Func</span>&lt;<span class="xref">IServiceProvider</span>, <span class="xref">Interceptor</span>&gt;</td>
  167. <td><span class="parametername">configureInvoker</span></td>
  168. <td><p>A delegate that is used to create an <see cref="!:Interceptor"></see>.</p>
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. <h5 class="returns">Returns</h5>
  174. <table class="table table-bordered table-striped table-condensed">
  175. <thead>
  176. <tr>
  177. <th>Type</th>
  178. <th>Description</th>
  179. </tr>
  180. </thead>
  181. <tbody>
  182. <tr>
  183. <td><span class="xref">IHttpClientBuilder</span></td>
  184. <td><p>An <see cref="!:IHttpClientBuilder"></see> that can be used to configure the client.</p>
  185. </td>
  186. </tr>
  187. </tbody>
  188. </table>
  189. <a id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_AddInterceptor_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.AddInterceptor*"></a>
  190. <h4 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_AddInterceptor__1_IHttpClientBuilder_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.AddInterceptor``1(IHttpClientBuilder)">AddInterceptor&lt;TInterceptor&gt;(IHttpClientBuilder)</h4>
  191. <div class="markdown level1 summary"><p>Adds an additional interceptor from the dependency injection container for a gRPC client.</p>
  192. </div>
  193. <div class="markdown level1 conceptual"></div>
  194. <h5 class="decalaration">Declaration</h5>
  195. <div class="codewrapper">
  196. <pre><code class="lang-csharp hljs">public static IHttpClientBuilder AddInterceptor&lt;TInterceptor&gt;(this IHttpClientBuilder builder)
  197. where TInterceptor : Interceptor</code></pre>
  198. </div>
  199. <h5 class="parameters">Parameters</h5>
  200. <table class="table table-bordered table-striped table-condensed">
  201. <thead>
  202. <tr>
  203. <th>Type</th>
  204. <th>Name</th>
  205. <th>Description</th>
  206. </tr>
  207. </thead>
  208. <tbody>
  209. <tr>
  210. <td><span class="xref">IHttpClientBuilder</span></td>
  211. <td><span class="parametername">builder</span></td>
  212. <td><p>The <see cref="!:IHttpClientBuilder"></see>.</p>
  213. </td>
  214. </tr>
  215. </tbody>
  216. </table>
  217. <h5 class="returns">Returns</h5>
  218. <table class="table table-bordered table-striped table-condensed">
  219. <thead>
  220. <tr>
  221. <th>Type</th>
  222. <th>Description</th>
  223. </tr>
  224. </thead>
  225. <tbody>
  226. <tr>
  227. <td><span class="xref">IHttpClientBuilder</span></td>
  228. <td><p>An <see cref="!:IHttpClientBuilder"></see> that can be used to configure the client.</p>
  229. </td>
  230. </tr>
  231. </tbody>
  232. </table>
  233. <h5 class="typeParameters">Type Parameters</h5>
  234. <table class="table table-bordered table-striped table-condensed">
  235. <thead>
  236. <tr>
  237. <th>Name</th>
  238. <th>Description</th>
  239. </tr>
  240. </thead>
  241. <tbody>
  242. <tr>
  243. <td><span class="parametername">TInterceptor</span></td>
  244. <td><p>The type of the <see cref="!:Interceptor"></see>.</p>
  245. </td>
  246. </tr>
  247. </tbody>
  248. </table>
  249. <a id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_ConfigureChannel_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.ConfigureChannel*"></a>
  250. <h4 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_ConfigureChannel_IHttpClientBuilder_Action_Grpc_Net_Client_GrpcChannelOptions__" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.ConfigureChannel(IHttpClientBuilder,Action{Grpc.Net.Client.GrpcChannelOptions})">ConfigureChannel(IHttpClientBuilder, Action&lt;GrpcChannelOptions&gt;)</h4>
  251. <div class="markdown level1 summary"><p>Adds a delegate that will be used to configure the channel for a gRPC client.</p>
  252. </div>
  253. <div class="markdown level1 conceptual"></div>
  254. <h5 class="decalaration">Declaration</h5>
  255. <div class="codewrapper">
  256. <pre><code class="lang-csharp hljs">public static IHttpClientBuilder ConfigureChannel(this IHttpClientBuilder builder, Action&lt;GrpcChannelOptions&gt; configureChannel)</code></pre>
  257. </div>
  258. <h5 class="parameters">Parameters</h5>
  259. <table class="table table-bordered table-striped table-condensed">
  260. <thead>
  261. <tr>
  262. <th>Type</th>
  263. <th>Name</th>
  264. <th>Description</th>
  265. </tr>
  266. </thead>
  267. <tbody>
  268. <tr>
  269. <td><span class="xref">IHttpClientBuilder</span></td>
  270. <td><span class="parametername">builder</span></td>
  271. <td><p>The <see cref="!:IHttpClientBuilder"></see>.</p>
  272. </td>
  273. </tr>
  274. <tr>
  275. <td><span class="xref">Action</span>&lt;<a class="xref" href="Grpc.Net.Client.GrpcChannelOptions.html">GrpcChannelOptions</a>&gt;</td>
  276. <td><span class="parametername">configureChannel</span></td>
  277. <td><p>A delegate that is used to configure a <a class="xref" href="Grpc.Net.Client.GrpcChannelOptions.html">GrpcChannelOptions</a>.</p>
  278. </td>
  279. </tr>
  280. </tbody>
  281. </table>
  282. <h5 class="returns">Returns</h5>
  283. <table class="table table-bordered table-striped table-condensed">
  284. <thead>
  285. <tr>
  286. <th>Type</th>
  287. <th>Description</th>
  288. </tr>
  289. </thead>
  290. <tbody>
  291. <tr>
  292. <td><span class="xref">IHttpClientBuilder</span></td>
  293. <td><p>An <see cref="!:IHttpClientBuilder"></see> that can be used to configure the client.</p>
  294. </td>
  295. </tr>
  296. </tbody>
  297. </table>
  298. <a id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_ConfigureChannel_" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.ConfigureChannel*"></a>
  299. <h4 id="Microsoft_Extensions_DependencyInjection_GrpcHttpClientBuilderExtensions_ConfigureChannel_IHttpClientBuilder_Action_IServiceProvider_Grpc_Net_Client_GrpcChannelOptions__" data-uid="Microsoft.Extensions.DependencyInjection.GrpcHttpClientBuilderExtensions.ConfigureChannel(IHttpClientBuilder,Action{IServiceProvider,Grpc.Net.Client.GrpcChannelOptions})">ConfigureChannel(IHttpClientBuilder, Action&lt;IServiceProvider, GrpcChannelOptions&gt;)</h4>
  300. <div class="markdown level1 summary"><p>Adds a delegate that will be used to configure the channel for a gRPC client.</p>
  301. </div>
  302. <div class="markdown level1 conceptual"></div>
  303. <h5 class="decalaration">Declaration</h5>
  304. <div class="codewrapper">
  305. <pre><code class="lang-csharp hljs">public static IHttpClientBuilder ConfigureChannel(this IHttpClientBuilder builder, Action&lt;IServiceProvider, GrpcChannelOptions&gt; configureChannel)</code></pre>
  306. </div>
  307. <h5 class="parameters">Parameters</h5>
  308. <table class="table table-bordered table-striped table-condensed">
  309. <thead>
  310. <tr>
  311. <th>Type</th>
  312. <th>Name</th>
  313. <th>Description</th>
  314. </tr>
  315. </thead>
  316. <tbody>
  317. <tr>
  318. <td><span class="xref">IHttpClientBuilder</span></td>
  319. <td><span class="parametername">builder</span></td>
  320. <td><p>The <see cref="!:IHttpClientBuilder"></see>.</p>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td><span class="xref">Action</span>&lt;<span class="xref">IServiceProvider</span>, <a class="xref" href="Grpc.Net.Client.GrpcChannelOptions.html">GrpcChannelOptions</a>&gt;</td>
  325. <td><span class="parametername">configureChannel</span></td>
  326. <td><p>A delegate that is used to configure a <a class="xref" href="Grpc.Net.Client.GrpcChannelOptions.html">GrpcChannelOptions</a>.</p>
  327. </td>
  328. </tr>
  329. </tbody>
  330. </table>
  331. <h5 class="returns">Returns</h5>
  332. <table class="table table-bordered table-striped table-condensed">
  333. <thead>
  334. <tr>
  335. <th>Type</th>
  336. <th>Description</th>
  337. </tr>
  338. </thead>
  339. <tbody>
  340. <tr>
  341. <td><span class="xref">IHttpClientBuilder</span></td>
  342. <td><p>An <see cref="!:IHttpClientBuilder"></see> that can be used to configure the client.</p>
  343. </td>
  344. </tr>
  345. </tbody>
  346. </table>
  347. </article>
  348. </div>
  349. <div class="hidden-sm col-md-2" role="complementary">
  350. <div class="sideaffix">
  351. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  352. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  353. </nav>
  354. </div>
  355. </div>
  356. </div>
  357. </div>
  358. <footer>
  359. <div class="grad-bottom"></div>
  360. <div class="footer">
  361. <div class="container">
  362. <span class="pull-right">
  363. <a href="#top">Back to top</a>
  364. </span>
  365. <span>Generated by <strong>DocFX</strong></span>
  366. </div>
  367. </div>
  368. </footer>
  369. </div>
  370. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  371. <script type="text/javascript" src="../styles/docfx.js"></script>
  372. <script type="text/javascript" src="../styles/main.js"></script>
  373. </body>
  374. </html>