public sealed class HttpTarget : IMessage<HttpTarget>, IEquatable<HttpTarget>, IDeepCloneable<HttpTarget>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Scheduler v1 API class HttpTarget.
Http target. The job will be pushed to the job handler by means of
an HTTP request via an
[http_method][google.cloud.scheduler.v1.HttpTarget.http_method] such as HTTP
POST, HTTP GET, etc. The job is acknowledged by means of an HTTP
response code in the range [200 - 299]. A failure to receive a response
constitutes a failed execution. For a redirected request, the response
returned by the redirected request is considered.
HTTP request body. A request body is allowed only if the HTTP
method is POST, PUT, or PATCH. It is an error to set body on a job with an
incompatible [HttpMethod][google.cloud.scheduler.v1.HttpMethod].
The user can specify HTTP request headers to send with the job's
HTTP request. This map contains the header field names and
values. Repeated headers are not supported, but a header value can
contain commas. These headers represent a subset of the headers
that will accompany the job's HTTP request. Some HTTP request
headers will be ignored or replaced. A partial list of headers that
will be ignored or replaced is below:
Host: This will be computed by Cloud Scheduler and derived from
[uri][google.cloud.scheduler.v1.HttpTarget.uri].
Content-Length: This will be computed by Cloud Scheduler.
User-Agent: This will be set to "Google-Cloud-Scheduler".
X-Google-*: Google internal use only.
X-AppEngine-*: Google internal use only.
X-CloudScheduler: This header will be set to true.
X-CloudScheduler-JobName: This header will contain the job name.
X-CloudScheduler-ScheduleTime: For Cloud Scheduler jobs specified in
the unix-cron format, this header will contain the job schedule as an
offset of UTC parsed according to RFC3339.
Required. The full URI path that the request will be sent to. This string
must begin with either "http://" or "https://". Some examples of
valid values for [uri][google.cloud.scheduler.v1.HttpTarget.uri] are:
http://acme.com and https://acme.com/sales:8080. Cloud Scheduler will
encode some characters for safety and compatibility. The maximum allowed
URL length is 2083 characters after encoding.
[[["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\u003eThis document provides reference information for the \u003ccode\u003eHttpTarget\u003c/code\u003e class within the Google Cloud Scheduler v1 API, which is used to define HTTP targets for scheduled jobs.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHttpTarget\u003c/code\u003e class allows specifying the HTTP method, URI, headers, and body for a job's HTTP request, supporting methods like POST, PUT, or PATCH.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication for \u003ccode\u003eHttpTarget\u003c/code\u003e requests can be handled by OAuth or OIDC tokens, attaching them as the Authorization header.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes properties for configuring the HTTP request, such as \u003ccode\u003eHttpMethod\u003c/code\u003e, \u003ccode\u003eUri\u003c/code\u003e, \u003ccode\u003eHeaders\u003c/code\u003e, and \u003ccode\u003eBody\u003c/code\u003e, with specific limitations and requirements for each.\u003c/p\u003e\n"],["\u003cp\u003eMultiple versions of the \u003ccode\u003eHttpTarget\u003c/code\u003e class are documented, ranging from version 2.2.0 up to the latest version, 3.5.0.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Scheduler v1 API - Class HttpTarget (3.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/latest/Google.Cloud.Scheduler.V1.HttpTarget)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/3.4.0/Google.Cloud.Scheduler.V1.HttpTarget)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/3.3.0/Google.Cloud.Scheduler.V1.HttpTarget)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/3.2.0/Google.Cloud.Scheduler.V1.HttpTarget)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/3.1.0/Google.Cloud.Scheduler.V1.HttpTarget)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/3.0.0/Google.Cloud.Scheduler.V1.HttpTarget)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/2.3.0/Google.Cloud.Scheduler.V1.HttpTarget)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/2.2.0/Google.Cloud.Scheduler.V1.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 Scheduler v1 API class HttpTarget.\n\nHttp target. The job will be pushed to the job handler by means of\nan HTTP request via an\n\\[http_method\\]\\[google.cloud.scheduler.v1.HttpTarget.http_method\\] such as HTTP\nPOST, HTTP GET, etc. The job is acknowledged by means of an HTTP\nresponse code in the range \\[200 - 299\\]. A failure to receive a response\nconstitutes a failed execution. For a redirected request, the response\nreturned by the redirected request is considered. \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.Scheduler.V1/latest/Google.Cloud.Scheduler.V1.HttpTarget), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[HttpTarget](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/latest/Google.Cloud.Scheduler.V1.HttpTarget), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[HttpTarget](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/latest/Google.Cloud.Scheduler.V1.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.Scheduler.V1](/dotnet/docs/reference/Google.Cloud.Scheduler.V1/latest/Google.Cloud.Scheduler.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Scheduler.V1.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### Body\n\n public ByteString Body { get; set; }\n\nHTTP request body. A request body is allowed only if the HTTP\nmethod is POST, PUT, or PATCH. It is an error to set body on a job with an\nincompatible \\[HttpMethod\\]\\[google.cloud.scheduler.v1.HttpMethod\\].\n\n### Headers\n\n public MapField\u003cstring, string\u003e Headers { get; }\n\nThe user can specify HTTP request headers to send with the job's\nHTTP request. This map contains the header field names and\nvalues. Repeated headers are not supported, but a header value can\ncontain commas. These headers represent a subset of the headers\nthat will accompany the job's HTTP request. Some HTTP request\nheaders will be ignored or replaced. A partial list of headers that\nwill be ignored or replaced is below:\n\n- Host: This will be computed by Cloud Scheduler and derived from \\[uri\\]\\[google.cloud.scheduler.v1.HttpTarget.uri\\].\n- `Content-Length`: This will be computed by Cloud Scheduler.\n- `User-Agent`: This will be set to `\"Google-Cloud-Scheduler\"`.\n- `X-Google-*`: Google internal use only.\n- `X-AppEngine-*`: Google internal use only.\n- `X-CloudScheduler`: This header will be set to true.\n- `X-CloudScheduler-JobName`: This header will contain the job name.\n- `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the unix-cron format, this header will contain the job schedule as an offset of UTC parsed according to RFC3339.\n\nThe total size of headers must be less than 80KB.\n\n### HttpMethod\n\n public HttpMethod HttpMethod { get; set; }\n\nWhich HTTP method to use for the request.\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 an `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### Uri\n\n public string Uri { get; set; }\n\nRequired. The full URI path that the request will be sent to. This string\nmust begin with either \"http://\" or \"https://\". Some examples of\nvalid values for \\[uri\\]\\[google.cloud.scheduler.v1.HttpTarget.uri\\] are:\n`http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will\nencode some characters for safety and compatibility. The maximum allowed\nURL length is 2083 characters after encoding."]]