Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
Say hello to Angular's future home!Check out Angular.devHome
/

HttpUrlEncodingCodec

Provides encoding and decoding of URL parameter and query-string values.

See more...

      
      class HttpUrlEncodingCodec implements HttpParameterCodec {
  encodeKey(key: string): string
  encodeValue(value: string): string
  decodeKey(key: string): string
  decodeValue(value: string)
}
    

Description

Serializes and parses URL parameter keys and values to encode and decode them. If you pass URL query parameters without encoding, the query parameters can be misinterpreted at the receiving end.

Methods

Encodes a key name for a URL parameter or query-string.

      
      encodeKey(key: string): string
    
Parameters
key string

The key name.

Returns

string: The encoded key name.

Encodes the value of a URL parameter or query-string.

      
      encodeValue(value: string): string
    
Parameters
value string

The value.

Returns

string: The encoded value.

Decodes an encoded URL parameter or query-string key.

      
      decodeKey(key: string): string
    
Parameters
key string

The encoded key name.

Returns

string: The decoded key name.

Decodes an encoded URL parameter or query-string value.

      
      decodeValue(value: string)
    
Parameters
value string

The encoded value.