public RepeatedField<HttpTarget.Types.HeaderOverride> HeaderOverrides { get; }
HTTP target headers.
This map contains the header field names and values.
Headers will be set when running the
[CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or
[BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask].
These headers represent a subset of the headers that will be configured for
the task's HTTP request. Some HTTP request headers will be ignored or
replaced.
A partial list of headers that will be ignored or replaced is:
Several predefined headers, prefixed with "X-CloudTasks-", can
be used to define properties of the task.
Host: This will be computed by Cloud Tasks and derived from
[HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url].
Content-Length: This will be computed by Cloud Tasks.
Content-Type won't be set by Cloud Tasks. You can explicitly set
Content-Type to a media type when the
[task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
For example,Content-Type can be set to "application/octet-stream" or
"application/json". The default value is set to "application/json".
User-Agent: This will be set to "Google-Cloud-Tasks".
Headers which can have multiple values (according to RFC2616) can be
specified using comma-separated values.
The size of the headers must be less than 80KB.
Queue-level headers to override headers of all the tasks in the queue.
When specified, it overrides
[HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the
task. Note that if the value is set to [HttpMethod][GET] the
[HttpRequest][body] of the task will be ignored at execution time.
[[["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-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eHttpTarget\u003c/code\u003e class in the Google Cloud Tasks v2beta3 API is used to define an HTTP target for tasks, allowing the configuration of how HTTP requests are executed.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eHttpTarget\u003c/code\u003e can override HTTP requests for tasks, including the HTTP method, with the GET method ignoring the task's request body at runtime, and it allows for header overrides to modify HTTP request headers when tasks are created or buffered.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication for HTTP requests can be managed through \u003ccode\u003eHttpTarget\u003c/code\u003e with OAuth or OIDC tokens, adding them as \u003ccode\u003eAuthorization\u003c/code\u003e headers, with the suggested use of OAuth for Google APIs and OIDC for broader scenarios.\u003c/p\u003e\n"],["\u003cp\u003eThe class also enables specifying a \u003ccode\u003eUriOverride\u003c/code\u003e, enabling a change of the execution URI for all tasks within a queue, overriding their default behavior.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eHttpTarget\u003c/code\u003e is available in multiple versions including [3.0.0-beta07, 3.0.0-beta06, 2.0.0-beta08], and implements various interfaces such as IMessage, IEquatable, IDeepCloneable, and IBufferMessage.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Tasks v2beta3 API - Class HttpTarget (3.0.0-beta07)\n\nVersion latestkeyboard_arrow_down\n\n- [3.0.0-beta07 (latest)](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.HttpTarget)\n- [3.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/3.0.0-beta06/Google.Cloud.Tasks.V2Beta3.HttpTarget)\n- [2.0.0-beta08](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/2.0.0-beta08/Google.Cloud.Tasks.V2Beta3.HttpTarget) \n\n public sealed class HttpTarget : IMessage\u003cHttpTarget\u003e, IEquatable\u003cHttpTarget\u003e, IDeepCloneable\u003cHttpTarget\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Tasks v2beta3 API class HttpTarget.\n\nHTTP target.\n\nWhen specified as a \\[Queue\\]\\[target_type\\], all the tasks with \\[HttpRequest\\]\nwill be overridden according to the target. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e HttpTarget \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[HttpTarget](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.HttpTarget), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[HttpTarget](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.HttpTarget), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[HttpTarget](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.HttpTarget), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\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.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Tasks.V2Beta3](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3)\n\nAssembly\n--------\n\nGoogle.Cloud.Tasks.V2Beta3.dll\n\nConstructors\n------------\n\n### HttpTarget()\n\n public HttpTarget()\n\n### HttpTarget(HttpTarget)\n\n public HttpTarget(HttpTarget other)\n\nProperties\n----------\n\n### AuthorizationHeaderCase\n\n public HttpTarget.AuthorizationHeaderOneofCase AuthorizationHeaderCase { get; }\n\n### HeaderOverrides\n\n public RepeatedField\u003cHttpTarget.Types.HeaderOverride\u003e HeaderOverrides { get; }\n\nHTTP target headers.\n\nThis map contains the header field names and values.\nHeaders will be set when running the\n\\[CreateTask\\]\\[google.cloud.tasks.v2beta3.CloudTasks.CreateTask\\] and/or\n\\[BufferTask\\]\\[google.cloud.tasks.v2beta3.CloudTasks.BufferTask\\].\n\nThese headers represent a subset of the headers that will be configured for\nthe task's HTTP request. Some HTTP request headers will be ignored or\nreplaced.\n\nA partial list of headers that will be ignored or replaced is:\n\n- Several predefined headers, prefixed with \"X-CloudTasks-\", can be used to define properties of the task.\n- Host: This will be computed by Cloud Tasks and derived from \\[HttpRequest.url\\]\\[google.cloud.tasks.v2beta3.Target.HttpRequest.url\\].\n- Content-Length: This will be computed by Cloud Tasks.\n\n`Content-Type` won't be set by Cloud Tasks. You can explicitly set\n`Content-Type` to a media type when the\n\\[task is created\\]\\[google.cloud.tasks.v2beta3.CloudTasks.CreateTask\\].\nFor example,`Content-Type` can be set to `\"application/octet-stream\"` or\n`\"application/json\"`. The default value is set to `\"application/json\"`.\n\n- User-Agent: This will be set to `\"Google-Cloud-Tasks\"`.\n\nHeaders which can have multiple values (according to RFC2616) can be\nspecified using comma-separated values.\n\nThe size of the headers must be less than 80KB.\nQueue-level headers to override headers of all the tasks in the queue.\n\n### HttpMethod\n\n public HttpMethod HttpMethod { get; set; }\n\nThe HTTP method to use for the request.\n\nWhen specified, it overrides\n\\[HttpRequest\\]\\[google.cloud.tasks.v2beta3.HttpTarget.http_method\\] for the\ntask. Note that if the value is set to \\[HttpMethod\\]\\[GET\\] the\n\\[HttpRequest\\]\\[body\\] of the task will be ignored at execution time.\n\n### OauthToken\n\n public OAuthToken OauthToken { get; set; }\n\nIf specified, an\n[OAuth token](https://developers.google.com/identity/protocols/OAuth2)\nwill be generated and attached as the `Authorization` header in the HTTP\nrequest.\n\nThis type of authorization should generally only be used when calling\nGoogle APIs hosted on \\*.googleapis.com.\n\n### OidcToken\n\n public OidcToken OidcToken { get; set; }\n\nIf specified, an\n[OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)\ntoken will be generated and attached as an `Authorization` header in the\nHTTP request.\n\nThis type of authorization can be used for many scenarios, including\ncalling Cloud Run, or endpoints where you intend to validate the token\nyourself.\n\n### UriOverride\n\n public UriOverride UriOverride { get; set; }\n\nURI override.\n\nWhen specified, overrides the execution URI for all the tasks in the queue."]]