PercentEncodingMode Enum
Definition
Identifies the set of characters PercentEncoding leaves unescaped, selecting the URI component or form-encoding rules to apply.
public enum PercentEncodingMode : byte
- Extension Methods
Fields
UriComponent = 0Encodes every byte except the RFC 3986 unreserved set (
ALPHA/DIGIT/-/./_/~). The safest default for an independent value embedded into any URI component.PathSegment = 1Encodes for a single RFC 3986 path segment: passes through unreserved characters, sub-delimiters,
:, and@, while encoding/,?, and#. Encode each segment separately and join with/.Query = 2Encodes for a whole RFC 3986 query component: passes through unreserved characters, sub-delimiters,
:,@,/, and?, while encoding#. For individual parameter names and values prefer UriComponent or FormUrlEncoded.FormUrlEncoded = 3Encodes per the WHATWG
application/x-www-form-urlencodedpercent-encode set: passes through only ASCII alphanumerics and*,-,.,_; encodes space as+, a literal plus as%2B, and a literal percent as%25.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |