public sealed class HttpHeaderMatch : IMessage<HttpHeaderMatch>, IEquatable<HttpHeaderMatch>, IDeepCloneable<HttpHeaderMatch>, IBufferMessage, IMessage
Reference documentation and code samples for the Compute Engine v1 API class HttpHeaderMatch.
The value should exactly match contents of exactMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.
The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method". When the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true, only non-binary user-specified custom metadata and the content-type header are supported. The following transport-level headers cannot be used in header matching rules: :authority, :method, :path, :scheme, user-agent, accept-encoding, content-encoding, grpc-accept-encoding, grpc-encoding, grpc-previous-rpc-attempts, grpc-tags-bin, grpc-timeout and grpc-trace-bin.
If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met. The default setting is false.
The value of the header must start with the contents of prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.
A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.
The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. For example for a range [-5, 0] - -3 will match. - 0 will not match. - 0.25 will not match. - -3someString will not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. rangeMatch is not supported for load balancers that have loadBalancingScheme set to EXTERNAL.
The value of the header must match the regular expression specified in regexMatch. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
The value of the header must end with the contents of suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.
[[["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-03 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eHttpHeaderMatch\u003c/code\u003e class within the Google.Cloud.Compute.V1 namespace, detailing its usage with the Compute Engine v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHttpHeaderMatch\u003c/code\u003e class is used to define criteria for matching HTTP request headers, allowing users to specify rules based on exact matches, prefixes, suffixes, regular expressions, presence, or integer ranges.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eHttpHeaderMatch\u003c/code\u003e class available in this documentation is 3.6.0, but several previous versions, ranging from 1.0.0 to 3.5.0, are also documented and accessible.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHttpHeaderMatch\u003c/code\u003e class implements multiple interfaces including IMessage, IEquatable, IDeepCloneable, and IBufferMessage and inherits members from the object class.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes properties like \u003ccode\u003eExactMatch\u003c/code\u003e, \u003ccode\u003ePrefixMatch\u003c/code\u003e, \u003ccode\u003eSuffixMatch\u003c/code\u003e, \u003ccode\u003eRegexMatch\u003c/code\u003e, \u003ccode\u003ePresentMatch\u003c/code\u003e, and \u003ccode\u003eRangeMatch\u003c/code\u003e to configure different header matching rules, with restrictions on using only one of these match types at a time.\u003c/p\u003e\n"]]],[],null,["# Compute Engine v1 API - Class HttpHeaderMatch (3.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.13.0 (latest)](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.12.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.11.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.10.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.9.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.8.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.7.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.6.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.5.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.4.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.3.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.2.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.1.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/3.0.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.17.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.17.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.16.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.16.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.15.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.14.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.13.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.12.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.11.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.10.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.9.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.8.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.7.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.6.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.5.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.4.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.3.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.2.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.1.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/2.0.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.4.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.3.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.2.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.1.0/Google.Cloud.Compute.V1.HttpHeaderMatch)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Compute.V1/1.0.0/Google.Cloud.Compute.V1.HttpHeaderMatch) \n\n public sealed class HttpHeaderMatch : IMessage\u003cHttpHeaderMatch\u003e, IEquatable\u003cHttpHeaderMatch\u003e, IDeepCloneable\u003cHttpHeaderMatch\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Compute Engine v1 API class HttpHeaderMatch.\n\nmatchRule criteria for request header matches. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e HttpHeaderMatch \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[HttpHeaderMatch](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HttpHeaderMatch), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[HttpHeaderMatch](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HttpHeaderMatch), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[HttpHeaderMatch](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.HttpHeaderMatch), [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.Compute.V1](/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Compute.V1.dll\n\nConstructors\n------------\n\n### HttpHeaderMatch()\n\n public HttpHeaderMatch()\n\n### HttpHeaderMatch(HttpHeaderMatch)\n\n public HttpHeaderMatch(HttpHeaderMatch other)\n\nProperties\n----------\n\n### ExactMatch\n\n public string ExactMatch { get; set; }\n\nThe value should exactly match contents of exactMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.\n\n### HasExactMatch\n\n public bool HasExactMatch { get; }\n\nGets whether the \"exact_match\" field is set\n\n### HasHeaderName\n\n public bool HasHeaderName { get; }\n\nGets whether the \"header_name\" field is set\n\n### HasInvertMatch\n\n public bool HasInvertMatch { get; }\n\nGets whether the \"invert_match\" field is set\n\n### HasPrefixMatch\n\n public bool HasPrefixMatch { get; }\n\nGets whether the \"prefix_match\" field is set\n\n### HasPresentMatch\n\n public bool HasPresentMatch { get; }\n\nGets whether the \"present_match\" field is set\n\n### HasRegexMatch\n\n public bool HasRegexMatch { get; }\n\nGets whether the \"regex_match\" field is set\n\n### HasSuffixMatch\n\n public bool HasSuffixMatch { get; }\n\nGets whether the \"suffix_match\" field is set\n\n### HeaderName\n\n public string HeaderName { get; set; }\n\nThe name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name \":authority\". For matching a request's method, use the headerName \":method\". When the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true, only non-binary user-specified custom metadata and the `content-type` header are supported. The following transport-level headers cannot be used in header matching rules: `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and `grpc-trace-bin`.\n\n### InvertMatch\n\n public bool InvertMatch { get; set; }\n\nIf set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met. The default setting is false.\n\n### PrefixMatch\n\n public string PrefixMatch { get; set; }\n\nThe value of the header must start with the contents of prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.\n\n### PresentMatch\n\n public bool PresentMatch { get; set; }\n\nA header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set.\n\n### RangeMatch\n\n public Int64RangeMatch RangeMatch { get; set; }\n\nThe header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. For example for a range \\[-5, 0\\] - -3 will match. - 0 will not match. - 0.25 will not match. - -3someString will not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. rangeMatch is not supported for load balancers that have loadBalancingScheme set to EXTERNAL.\n\n### RegexMatch\n\n public string RegexMatch { get; set; }\n\nThe value of the header must match the regular expression specified in regexMatch. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.\n\n### SuffixMatch\n\n public string SuffixMatch { get; set; }\n\nThe value of the header must end with the contents of suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set."]]