public static DelegatingHandler ToDelegatingHandler(this IHttpExecuteInterceptor interceptor)
Creates aDelegatingHandlerwhich applies the execution interceptor
ininterceptor(usually a credential) before delegating onwards.
TheInnerHandlerof the returned handler must be specified before
the first request is made.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eHttpExtensions\u003c/code\u003e class provides extension methods for \u003ccode\u003eHttpRequestMessage\u003c/code\u003e and \u003ccode\u003eHttpResponseMessage\u003c/code\u003e within the Google.Apis.Http namespace.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSetEmptyContent\u003c/code\u003e method is a utility for setting empty HTTP content in a \u003ccode\u003eHttpRequestMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eToDelegatingHandler\u003c/code\u003e method creates a \u003ccode\u003eDelegatingHandler\u003c/code\u003e to apply an \u003ccode\u003eIHttpExecuteInterceptor\u003c/code\u003e before further delegation, optionally specifying an \u003ccode\u003einnerHandler\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis documentation provides access to versions 1.50.0, 1.55.0, 1.59.0, 1.60.0, 1.68.0 and the latest 1.69.0 of the class.\u003c/p\u003e\n"]]],[],null,["# Class HttpExtenstions (1.69.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.69.0 (latest)](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.HttpExtenstions)\n- [1.68.0](/dotnet/docs/reference/Google.Apis/1.68.0/Google.Apis.Http.HttpExtenstions)\n- [1.60.0](/dotnet/docs/reference/Google.Apis/1.60.0/Google.Apis.Http.HttpExtenstions)\n- [1.59.0](/dotnet/docs/reference/Google.Apis/1.59.0/Google.Apis.Http.HttpExtenstions)\n- [1.55.0](/dotnet/docs/reference/Google.Apis/1.55.0/Google.Apis.Http.HttpExtenstions)\n- [1.50.0](/dotnet/docs/reference/Google.Apis/1.50.0/Google.Apis.Http.HttpExtenstions) \n\n public static class HttpExtenstions\n\nExtension methods to [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) and\n[HttpResponseMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httpresponsemessage). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e HttpExtenstions \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Apis.Http](/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http)\n\nAssembly\n--------\n\nGoogle.Apis.Core.dll\n\nMethods\n-------\n\n### SetEmptyContent(HttpRequestMessage)\n\n public static HttpContent SetEmptyContent(this HttpRequestMessage request)\n\nA Google.Apis utility method for setting an empty HTTP content.\n\n### ToDelegatingHandler(IHttpExecuteInterceptor)\n\n public static DelegatingHandler ToDelegatingHandler(this IHttpExecuteInterceptor interceptor)\n\nCreates a [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) which applies the execution interceptor\nin `interceptor` (usually a credential) before delegating onwards.\nThe [InnerHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler.innerhandler) of the returned handler must be specified before\nthe first request is made.\n\n### ToDelegatingHandler(IHttpExecuteInterceptor, HttpMessageHandler)\n\n public static DelegatingHandler ToDelegatingHandler(this IHttpExecuteInterceptor interceptor, HttpMessageHandler innerHandler)\n\nCreates a [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler) which applies the execution interceptor\nin `interceptor` (usually a credential) before delegating onwards."]]